Police official S Boralingaiah told reporters: "It was a long struggle to capture the leopard. Although it was injected with tranquilisers it could be captured only around 20.15 local time when the medication took full effect."
It is thought the eight-year-old male could have wandered into the school from a patch of nearby forest.
India has an estimated leopard population of between 12,000 and 14,000, and the big cats have been known to stray into populated areas.
Experts warn that the animals could come into contact with humans more frequently as their habitats are increasingly encroached upon.