The actual decline of the Pallavas started during the long reign of Dantivarman with a belligerent Pandyans encroaching from the south. In this chaos, Vijayalaya a feudatory of the Pallavas of the erstwhile Chola lineage defeated Muthurayars, a Pandyan feudatory based in the area around Thanjavur and occupied their areas around 850 AD. The final showdown came in the reign of his successor Nandivarman III where the Pandyan king Srimara Srivallabha who advanced North was defeated at Tellaru in 862 and chased till Madurai. Nandivarman was allied with Rashtrakutas and Gangas in this campaign and the victory was complete. However, the Pandyan king bounced back and defeated the Pallavas at Kumbakonam. Nandivarman was followed by his son Nripatunga who was a boy when he took the throne as the choice of his father (a bit hard to understand going by the fact his previous three generations clocked a total of 137 years in between) may be due to the fact that his mother is a Rashtrakuta Princess bypassing the elder Kampavarman in 862. It is assumed that Kampavarman defeated his brother early in the reign but left him on the throne, making his son, Aparajita the successor of Nripatunga. Things came to a head on in 879 when Aparajita allied with the Gangas defeated Nripatunga allied with Pandyans and Banas at Sri Purambiyam in Thanjavur district. The Ganga ruler Prithvipati and Varagunavarman, the Pandyan king lost their lives in the campaign. After the defeat and death of the Pandyan king Varagunavarman II, as a token of appreciation for his contribution in the battle, Aparajita gave the Thanjavur area as a reward to Aditya Chola, the son of Vijayalaya. Maybe for defeating him at Chirrarrur to show his place, Aditya Chola turned against his master in 891 and killed him in a battle and possibly married his wife thus ending the Pallava line for good. Kampavarman was still alive and some charters of his are seen after 891. However, there is another argument that Nripatunga is an alternate name for Aparajita himself. Later we see a Nolamba line claiming descent from Trilochana Pallava ruling till 1300s and Kadava Pallavas claiming descent from the line of Bhimavarman whose reign was extinguished along with that of Cholas while trying to prop up the Cholas while fighting with Pandyans on one side and Kakatiyas on the other.