However, the 11th century Persian poet Mas'ūd Sa'd Salmān writes of a desperate assault on the fortress of Agra, then held by the Shāhī King Jayapala, by Sultan Mahmud of Ghazni.
In 1001, he defeated Raja Jayapala of the Hindu Shahi Dynasty of Gandhara in the Battle of Peshawar and marched further into Peshawar and, in 1005, made it the center for his forces.