Unexpected Spellcasting Ability (3.5e Template)
From D&D Wiki
Unexpected Spellcasting Ability
This is an inherited template that can be added to any intelligent creature(Int at least 4).
This template results in some kind of failure in the flow of cosmic energies and so gives randomly some spellcasting abilities to a newborn child.
The creature with this template gains natural spellcasting ability(like those of a rakshasa and nymph) in one spellcasting class as a spellcaster of level equal to the racial hit dice of the creature. If the creature has no racial hit dice it gains one caster level.
Additionally the creature's favored class becomes the one whose spellcasting ability the creature gained through this template and the creatures ability score governing the spellcasting of the class increases by 4.