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.
An erstwhile viceroy of the Vijayanagar empire assumed independence and founded the dynasty of the Thanjavur Nayaks. Thanjavur remained the capital of the Nayaks for the next one hundred and twenty five years till Vijayaraghava - the last prince of the line - perished in a tragic. His General Alagiri ruled for another fourteen years. The claim to the Nayak throne through Sengamaladas, the infant son of Vijayaraghava brought on the scene the Bijapur King and his general.
General Venkaji alias Ekoji, was the half brother of Sivaji the Great. He defeated Alagiri and seized the throne in 1676 because of the dissensions in Nayaks. Mahrattas kings ruled Thanjavur as the capital for one hundred and seventy-nine years. The English first interfered in 1749 AD with a view to the restoration of the deposed King, Saiyaji.
In 1758 AD French attacked Thanjavur, but were retaken by British in 1773 AD. Thanjavur became a protected state under the East India Company. In 1799 AD Thanjavur became a British principality and its ruler Sarafoji II was given the fort of Thanjavur and an area outside it. Sivaji, his successor died in 1855 AD without an heir and after him Thanjavur passed directly under British. Its acquisition never costs the life of a single soldier, in the same manner as the Mahrattas had taken the country previously from the Nayaks.
Of the various rulers of Thanjavur, the Cholas seem to have left the Great temple of Sri Bragatheeswara a striking relic of their genius. The temple stands tall within the small fort, commonly called the Sivaganga Fort, ascribed to the Sevvappa Nayak and the big fort which encircles the city and the palace was built by Vijayaraghava the last. These two forts could be the renovations of the earlier chola fortifications.