On reaching Agra, the Marathas made peace with Suraj Mal and advanced to Yamuna. They crossed Yamuna at Agra, occupied Etawah and Sikandra, and encamped at Kasganj on the southern bank of the Ganga on 17 June 1757. Antaji Mankeshwar went to Anupshahar about 2 July 1757. Meerut which was occupied by Najib Khan's agents resisted the Marathas but were swiftly defeated. Imad-ul-mulk sent his diwan Nagar Mal to Anupshahar to establish friendly relations with the Marathas once again. Shuja-ud-daulah had agreed to remain neutral in the conflict between Najib-ud-daulah and the Marathas. Thus most of the Doab was freed of Najib's agents and came under the control of Marathas. Ahmad Shah Abdali, before heading home in Afghanistan, kept Alamgir II on the throne with Imad-ul-Mulk as his wazir. But Abdali gave all the real power to Najib-ud-Daulah, his supreme agent in India and made him Mir Bakshi. Alamgir II, Imad-ul-Mulk all wanted to be free from Najib Khan's dominance and asked the Marathas for aid in liberating Delhi from Afghan influence. Ragunathrao agreed and marched on the imperial capital in July 1757. Sakharam Bapu who was present in the Doab region at the time, occupied Patparganj, and Shamsher Bahadur with the artillery division reached Rewari on 27 July 1757. Grain was stopped from entering the city. Najib Khan in preparation of the coming battle, dug trenches at Khizirabad outside the city to halt the cavalry advance of the Marathas. Najib Khan on hearing of Ragunathrao's advance, sent his wakil Meghraj to Imad-ul-Mulk to seek terms of peace, but Imad proposed humiliating terms which were unacceptable to Najib. And so there was no other alternative to settle this conflict other than war. Ragunathrao reached Khizirabad on 11 August 1757 with his lieutenants where he was joined by Sakharam Bapu who had crossed over from Doab. Ragunathrao sent two Maratha divisions to attack Delhi.