However, the army was hopeless in battle against the eastern forces, particularly against the Punjabis.[1] In the year 1001, soon after Sultan Mahmud came to power and was occupied with the Qarakhanids north of the Hindu Kush, Maharaja Jayapala attacked Ghazni once more and upon suffered his first defeat by the powerful numerous Ghaznavid forces, near present-day Peshawar. After the Battle of Peshawar, Jayapala was captured, and although he was freed by a 50 elephant indemnity.