The potion of invulnerability is a SLASH'EM item which causes the player to become invulnerable for several turns. This is not the same as the "invulnerability" offered by a successful prayer. The potion only protects from hit-point loss. A blessed potion makes you invulnerable for 12-15 turns, uncursed for 8-11, cursed for 4-7.
Several potions of invulnerability are guaranteed in the SLASH'EM special levels.