The approach of the united armies towards Farrukhabad obliged Ahmad Khan to raise the siege of Allahabad, and after some discussion he decided to return to protect his own home. But the discouragement produced by this retreat proved too much for his mercenaries and they melted away until when he reached Fatehgarh he had too small a force to attempt to do more than hold the fort. After a month's siege a Rohilla army under Sadullah Khan and Bahadur Khan came down to his assistance, but was defeated by the Marathas, and Ahmad Khan then fled through Rohilkhand to Kumaon, where he remained till 1752, when a fresh invasion of India by Ahmad Shah Durrani made Safdar Jang and the Marathas anxious for pease. It was agreed that Rohilkhand and Farrukhabad should be evacuated on condition that Ahmad Khan took over the debt of thirty lakhs of rupees due from Safdar Jang to the Marathas as pay for their services, ceding as security for the debt sixteen and a half of the thirty three mahals comprised in his territories. The management of the whole remained in the hands of Ahmad Khan, who paid the surplus revenue, after deducting the cost of management and the pay of the troops, to two Marathas agents stationed at Kanauj and Aliganj. Payments continued to be made till the battle of Panipat in 1761, when the Marathas left Doab.