According to The Georgian Chronicles the city was established in the 9th century by Guaram Mampal, son of the King of Tao. From the 13th to the end of 14th centuries it was the capital city of Samtskhe-Saatabago, ruled by the Georgian princely (mtavari) family and a ruling dynasty of the Principality of Samtskhe, the House of Jaqeli.
In 1393 the city was attacked by the armies of Tamerlane. Despite the Turko-Mongol invasions fortress withstood and continued to thrive. After the Treaty of Constantinople in 1590, the whole territory of Samtskhe-Saatabago went under the rule of Ottoman Empire. Turks Mostly used to build defensive edifices. In 1752 first mosque was built in Rabati.