The Marathas had gained control of a considerable part of India in the intervening period (1707–1757). In 1758, they occupied Delhi, captured Lahore and drove out Timur Shah Durrani, the son and viceroy of the Afghan ruler, Ahmad Shah Abdali. This was the high-water mark of the Maratha expansion, where the boundaries of their empire extended in the north to the Indus and the Himalayas, and in the south nearly to the extremity of the peninsula. This territory was ruled through the Peshwa, who talked of placing his son Vishwasrao on the Mughal throne. However Delhi still remained under the nominal control of Mughals, key Muslim intellectuals including Shah Waliullah and other Muslim clergy in India and Punjab who were alarmed at these developments. In desperation they appealed to Ahmad Shah Abdali, the ruler of Afghanistan, to halt the threat.