Terebovlia is an ancient town which was the capital of the Old Russian Terebovlia principality in the 10th- 13th centuries. The historic center of the old town was Zamkova (Castle) Hill, the top of which is still been encircled by the stout castle walls. Not only the walls have been preserved, but also bulwarks, while the internal buildings of the fortress have been lost.
Zamkova Hill rises for 50 meters above the confluence of two small rivers, and it was a convenient place for a fortified settlement. Written sources mentioning Terebovlia date back to the 10lh century; at this time on Zamkova Hill there was an Old Russian settlement, the center of which was the fortified princely court, the residence of Terebovlian princes.
In 1241, the wave of Tatar-Mongol invasion led by Batu Khan approached the city. Terebovlia was captured and destroyed, and for the next hundred years it was in vassalage of the Golden Horde.
In the 1340s years the Polish king Kasimir III the Great conquered a part of Ukrainian lands, and by 1360, the construction of a stone castle in Terebovlia was completed. This castle occupied a top of the mountain. It had to survive a lot of hostile invasions up to 1498, when Terebovlia was captured by the Moldavian ruler Stefan III the Great. The castle was destroyed, and despite further attempts to restore it, they were not enough to offer a good protection against the enemy. Meanwhile, in the early 17th century enemy attacks on Terebovlia became more frequent. The city required new defense.
In 1631, buildinq of a new castle, one of the most powerful in the Western Ukraine, began under supervision of Terebovlia headman Oleksandr Balaban.