At the time of 848 CE, there was a struggle or war between the Pallavas and Pandyas. Vijayalaya Chola used this as his own oppurtunity. He captured the Thanjavur region from Elango Mutharaiyars . In this disturbed state of affairs, Vijayalaya defeated the Pandyas, and made himself the ruler of Thanjavur and the surrounding Chola country. He also defeated the Pallavas. After Vijayalaya’s capture of Thanjavur, the Pandyan king Varagunavarman II (c. 862 – 885 CE) made alliance with the Pallava king Nandivarman III (c. 846 – 869 CE). Nandhivarman wished to destroy the growing influence of Chola power under Vijayalaya and called upon the Varagunavarman to help suppress Vijayalaya. Varaguna led an expedition into the Chola country. The Pandyan army reached the north bank of the Kaveri near Thanjavur. Vijayalaya, by this time was aging and was an invalid. The crown prince Aditya I took control of the army in the defence of the Chola kingdom. Vijayalaya was succeeded after his death c. 871 CE by his son Aditya I.