It took five hours for experts to be able to get close enough to the elephant to tranquilize him.
The trouble began last evening when four elephants were separated from their herd after villagers chased them away from their fields nearby.
Two elephants retreated towards the forests in the area, but the other two wandered into the city and were separated from each other near Bamboo Bazaar.
One was eventually trapped at a farm near Naidu Nagar; the other rushed through the city.
"This belt around Mysore, the forest in that belt which are barely 50 km from Mysore harbour 2000 wild elephants. It is the largest population of Asian elephants. The movement of elephants out of the forest towards the sources of food has increased," said a wildlife official.
He also said the panic that set in quickly exacerbated the problem. "If left alone the police and the forest department will do a reasonable job of solving the problem reasonably quickly - but people behave very irrationally, form mobs and mob the animals - and after all these are wild animals. They are confined in a strange place, they are terrified with the noise and the mobs and then they do these things."
Follow NDTV for latest election news and live coverage of assembly elections 2019 in Maharashtra and Haryana.
Subscribe to our YouTube channel, like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.