Bangalore was sold to the Wadiyar dynasty by the Mughals .
In 1638 , the Marāthās conquered and ruled Bangalore for almost 50 years , after which the Mughals captured and sold the city to the Mysore Kingdom of the Wadiyar dynasty .
Bangalore