A leopard has wandered into a school in southern India and injured three people as it tried to escape, officials said.

Onlookers including TV news crews watched the chase, which lasted several hours until forest workers shot the big cat with a tranquilliser dart, according to the Press Trust of India news agency.

The agency quoted school officials as saying the leopard was first seen on CCTV before dawn in the private Vibgyor School in Bangalore, and then disappeared into surrounding bushes.

The big cat later scaled a wall to re-enter the school grounds. It attacked and injured three people including a vet and a man who was trying to climb over a gate to get away, the agency reported.

Police said the three are being treated in hospital.