After the death of Maravarman Kulasekhara I (1310), his sons Vira Pandya IV and Sundara Pandya IV fought a war of succession for control of the empire. It seems that Maravarman Kulasekhara wanted Vira Pandya to succeed him (who in turn was defeated by Sundara Pandya after a short period of time). Unfortunately, the Pandya civil war coincided with the Khalji raids in south India. Taking advantage of the political situation, the neighbouring Hoysala king Ballala III invaded the Pandya territory. However, Ballala had to retreat to his capital, when Khalji general Malik Kafur invaded his kingdom at the same time. After subjugating Ballala III, the Khalji forces marched to the Pandya territory in March 1311. The Pandya brothers fled their headquarters, and the Khaljis pursued them unsuccessfully. By late April 1311, the Khaljis gave up their plans to pursue the Pandya princes, and returned to Delhi with the plunder. By 1312 the Pandya control over south Kerala was also lost.