Indeed, Humayun fought Sher Shah at the battle of Kannauj on 17 May 1540. Humayun was soundly defeated. He retreated to Agra, pursued by Sher Shah, and thence through Delhi to Lahore. Having defeated the Mughal Emperor, Sher Shah founded the short-lived Sur Empire, with its capital at Delhi, resulting in Humayun's exile for 15 years in the court of Shah Tahmasp I.