The Mughal power in northern India had been declining since the reign of Aurangzeb, who died in 1707. In 1751-52, the Ahamdiya treaty was signed between the Marathas and Mughals, when Balaji Bajirao was the Peshwa of the Maratha Empire. Through this treaty, the Marathas controlled large parts of India from their capital at Pune and Mughal rule was restricted only to Delhi . Marathas were now straining to expand their area of control towards the Northwest of India. Durrani sacked the Mughal capital and withdrew with the booty he coveted. To counter the Afghans, Peshwa Balaji Bajirao sent Raghunathrao. He succeeded in ousting Timur Shah and his court from India and brought northwest of India up to Peshawar under Maratha rule. Thus, upon his return to Kandahar in 1757, Durrani chose to return to India and confront the Maratha forces to regain northwestern part of the subcontinent. In 1761, Durrani set out on his campaign to win back lost territories. The early skirmishes ended in victory for the Afghans against the Maratha garrisons in northwest India. By 1759, Durrani and his army had reached Lahore and were poised to confront the Marathas. By 1760, the Maratha groups had coalesced into a big enough army under the command of Sadashivrao Bhau. Once again, Panipat was the scene of a battle for control of northern India. The Third battle of Panipat was fought between Durrani's Afghan forces and the Maratha forces in January 1761, and resulted in a decisive Durrani victory. This brought Punjab till north of Sutlej river under Afghan control. Ahmad Shah Durrani vacated Delhi soon after the battle. But the victory did not last, 10 years later the Maratha Empire recaptured lost lands.. Who was Durrani fighting?