While the Pandyas and the Rashtrakutas were busy engaging the Pallavas, with the Gangas and the Simhalas (Sri Lanka) also in the mix, the Cholas emerged from the Kaveri delta and took on the chieftains of Thanjavur (the Mutharaiyar chieftain had transferred their loyalty from the Pallava to the Pandya). The Chola king Vijayalaya conquered Thanjavur by defeating the Mutharaiyar chieftain around c. 850 CE. The Pandya control north of the Kaveri river was severely weakened by this move (and straightened the position of the Pallava ruler Nripatunga). Pandya ruler Varaguna-varman II (r. c. 862–880 CE) responded by marching into the Chola country and facing a formidable alliance of Pallava prince Aparajita, the Chola king Aditya I and the Ganga king Prithvipati I. The Pandya king suffered a crushing defeat (c. 880 CE) in a battle fought near Kumbakonam.