Dispel magic

Dispel magic is a widespread abjuration spell that cancels magical spells and effects.

Effect
Because magic is powerful, so, too, is the ability to dispel magic. You can use dispel magic to end ongoing spells that have been cast on a creature or object, to temporarily suppress the magical abilities of a magic item, to end ongoing spells (or at least their effects) within an area, or to counter another spellcaster's spell. A dispelled spell ends as if its duration had expired. Some spells, as detailed in their descriptions, can't be defeated by dispel magic. Dispel magic can dispel (but not counter) the ongoing effects of supernatural abilities as well as spells. Dispel magic affects spell-like effects just as it affects spells.

Note: The effects of spells with instantaneous duration can't be dispelled, because the magic effect is already over before the dispel magic can take effect. Thus, you can't use dispel magic to repair fire damage caused by a fireball or to turn a petrified character back to flesh. (The magic has departed, leaving only burned flesh or perfectly normal stone in its wake.)

You choose to use dispel magic in one of three ways: a targeted dispel, an area dispel, or a counterspell.

Targeted Dispel
One object, creature, or spell is the target of the spell. You make a dispel check against the spell or against each ongoing spell currently in effect on the object or creature. A dispel check is 1d20 +1 per caster level (maximum +10) against a DC of 11 + the spell's caster level.

For example, Mialee, at 5th level, targets dispel magic on a hasted, mage armored, strengthened drow. All three spells were cast on the drow by a 7th-level wizard. Mialee makes a dispel check (1d20+5 against DC 18) three times, once each for the haste, mage armor, and strength effects. If she succeeds at a particular check, that spell is dispelled (the drow’s SR doesn’t help him); if she fails, that spell remains in effect.

If the spellcaster targets an object or creature who is the effect of an ongoing spell (such as a monster summoned by monster summoning), she makes a dispel check to end the spell that conjured the object or creature.

If the object that you target is a magic item, you make a dispel check against the item's caster level. If you succeed, all the item’s magical properties are suppressed for 1d4 rounds, after which the item recovers on its own. A suppressed item becomes nonmagical for the duration of the effect. An interdimensional interface (such as a bag of holding) is temporarily closed.

Remember that a magic item's physical properties are unchanged: a suppressed magic sword is still a sword (a masterwork sword, in fact). Artifacts and creatures of demigod or higher status are unaffected by mortal magic such as this.

You automatically succeed at your dispel check against any spell that you cast yourself.

Area Dispel
The spell affects everything within a 30-foot radius.

For each creature who is the target of one or more spells, you make a dispel check against the spell with the highest caster level. If that fails, you make dispel checks against progressively weaker spells until you dispel one spell (which discharges the dispel so far as that target is concerned) or fail all your checks. The creature's magic items are not affected.

For each object that is the target of one or more spells, you make dispel checks as with creatures. Magic items are not affected by area dispels.

For each ongoing area or effect spell centered within the dispel magic's area, you make a dispel check to dispel the spell.

For each ongoing spell whose area overlaps that of the dispel, you make a dispel check to end the effect, but only within the area of the dispel magic.

If an object or creature who is the effect of an ongoing spell, such as a monster summoned by monster summoning, is in the area, you make a dispel check to end the spell that conjured the object or creature (returning it whence it came) in addition to attempting to dispel spells targeting the creature or object.

You may choose to automatically succeed at dispel checks against any spell that you have cast.

Counterspell
The spell targets a spellcaster and is cast as a counterspell (see page 152 of the Player’s Handbook). Unlike a true counterspell, however, dispel magic may not work. You must make a dispel check to counter the other spellcaster’s spell.