A wild elephant gored a man to death, lunged at vehicles in traffic and injured several people during a five-hour rampage Wednesday through Mysore in southern India after farmers chased it from a field outside the city.

Residents scattered and shouted as the young male elephant barrelled through city streets and then darted into an alley where it turned suddenly on the victim and gored him at the stoop of a home as residents looked on in horror.

Later, the elephant charged toward people who took cover atop a staircase, and lunged at an SUV on a main street.

Several people were injured during the five hours it took to tranquillize the animal, officials said.

Earlier, four elephants had entered some fields on the outskirts of the city after getting separated from their herd, Press Trust of India news agency reported. Farmers chased the animals, sending two of them back into nearby forests. One of them was later trapped at the farm, while the remaining one entered the city.

Hundreds of people die in India annually when wild animals wander into cities as their habitats shrink and they have to range farther for food. Its parks face massive encroachment from people who live and forage in the forests or graze cattle there.