Impotent Possessor
The caster renders one creature that can possess or inhabit other creatures, or a creature that can move its mind out of its body, powerless within the host it currently inhabits.
Book of Vile Darkness 3.5
By Monte Cook
Abjuration
Level: Sorcerer/Wizard 6
Components: V, S
Casting Time: 1 action
Range: Close (25 ft. + 5 ft./2 levels)
Target: One possessing creature
Duration: Permanent (D)
Saving Throw: Will negates
Spell Resistance: Yes
Potential targets include possessing demons, malevolent ghosts, and a caster currently using a magic jar spell. The only action the subject can take is to leave the body it currently inhabits. This spell, in conjunction with Imprison Possessor, is one of the best ways to deal with a possessing fiend.