Thanjavur (also known as Tanjore) is the royal city of the Cholas and Nayaks. Thanjavur derives its name from Tanjan-an asura (giant), who according to local legend devastated the neighbourhood and was killed by Sri Anandavalli Amman and Vishnu. Sri Neelamegapperumal Tanjan's last request that the city might be named after him was granted. Chola, Chera and Pandya kings were ruling Tamizhagam even before Mahabharat period. Chola kingdom was leading and patronizing literature, art, science and religion than the other two kingdoms. The capital city of Chola was always changing. Thiruvarur was the capital during Manuneethi Cholan. Uraiyur, Pazhaiyarai, Thanjavur and Gangaikonda Cholapuram used to be the capitals of Chola Kingdom. It has been believed from the Epics that many Chola kings were ruling from Thanjavur even before Karikala Cholan.
Historians believe that Thanjavur was captured by Vijayalaya Cholan (AD 846-880) from Perumpidugu Muttaraiyan. From then till Rajaraja Cholan, Thanjavur was flourishing. Chola kings were ruling till 13th Century AD with Thanjavur as their capital. Rajendra Cholan, Rajarajan's son moved the Chola capital to Gangaikonda Cholapuram. After that Chola Kingdom started declining and the Pandya Kings captured Thanjavur.