The current estimated population is 221,300 (as of 2004).
The city was founded in 1540 by Jan Amor Tarnowski as a Polish military stronghold and a castle. In 1544 the Ternopil castle was constructed and repelled its first Tatar attacks. In 1548 Ternopil was granted city rights by king Sigismund I of Poland. In 1567 the city passed to the Ostrogski family. In 1575 it was plundered by Tatars. In 1623 the city passed to the Zamoyski family.
In the 17th century the town was almost wiped from the map in the Khmelnytsky Uprising which drove out or killed most of its Jewish residents. Ternopil was almost completely destroyed by Turks and Tatars in 1675 and rebuilt by Aleksander Koniecpolski but did not recover its previous glory until it passed to Marie Casimire, the wife of king Jan III Sobieski in 1690. The city was later sacked for the last time by Tatars in 1694, and twice by Russians in the course of the Great Northern War in 1710 and the War of the Polish Succession in 1733. In 1747 Józef Potocki invited the Dominicanes and founded the beautiful late baroque Dominican Church (today the Cathedral of the Immaculate Conception of The Blessed Virgin Mary of the Ternopil-Zboriv eparchy of the Ukrainian Greek Catholic Church). The city was thrice looted during the confederation of Bar (1768–1772), by the confederates themeselves, by the kings army and by Russians. In 1770 it was further devastated by an outbreak of smallpox.
In 1772 the city came under Austrian rule after the First Partition of Poland. At the beginning of the 19th century the local population put great hopes into Napoleon Bonaparte, in 1809 the city came under Russian rule, which created to Ternopol krai there. In 1815 the city (then with 11,000 residents) returned to Austrian rule in accordance with the Congress of Vienna. In 1820 Jesuits expelled from Polatsk by Russians established a gymnasium in the town. In 1870 a rail line connected Tarnopol with Lviv, accelerating the city's growth. At that time Ternopil had a population of about 25,000.
During World War I the city passed from German and Austrian forces to Russia several times. In 1917 it was burnt down by fleeing Russian forces. After the dissolution of the Austro-Hungarian Empire the city was proclaimed part of the West Ukrainian People's Republic on 11 November 1918. During the Polish-Ukrainian War it was the country's capital from 22 November to 30 December after Lviv was captured by Polish forces. After the act of union between Western-Ukrainian Republic and the Ukrainian People's Republic (UPR), Ternopil formally passed under the UPR's control. On 15 July 1919 the city was captured by Polish forces. In 1920 the exiled Ukrainian government of Symon Petlura accepted the Polish control of Ternopil and of the entire area in exchange for the Polish assistance in restoration of Petlura's government in Kyiv. This effort ultimately failed, and in July and August 1920 Ternopil was captured by the Red Army in the course of the Polish-Soviet War and served as the capital of the Galician Soviet Socialist Republic. By the terms of the Riga treaty that ended the Polish-Soviet war, the Soviet Russia recognized the Polish control of the area.
From 1922 to September 1939, it was the capital of the Ternopil voivodship that consisted of 17 powiats. The policies of the Polish authorities, especially the assimilationist ethnic policies, affected all spheres of public life. Ukrainians, who according to the 1939 Statistical Yearbook of Poland, made less than half of voivodship's population, were restricted in their rights and were prosecuted for any attempts to oppose the Polonization. This created a strong backlash and strengthened the position of the militant Organization of Ukrainian Nationalists whose local Ternopil branch was led by Roman Paladiychuk and Taras Stetsko, the future leader of OUN,
In 1939 it was a city of 40,000; 50% of the population was Polish, 40% Jewish and 10% Ukrainian.
During the Polish Defensive War it was annexed by the Soviet Union and attached to the Ukrainian Soviet Socialist Republic. The Soviets continued the campaign against the Organization of Ukrainian Nationalists aided by the information given to them by the former Polish authorities. The Soviets also carried the mass deportations of the Polish part of the population to Kazakhstan. In 1941 the city was occupied by the Germans who continued exterminating the population by murdering the Jews and sending others to forced labor in Germany. In april 1944 the city was retaken by the Red Army, the remaining Polish population has been previously expelled. During the soviet reoccupation in march and april 1944 the city was encircled and completely destroyed. In march 1944 the city has been declared a fortified place by Adolf Hitler, to defend until the last round was shot. The stiff german resistance caused extensive use of heavy artillery by the Red Army, resulting in the complete destruction of the city and killing of nearly all german defenders. (55 survivors out of 4,500) Unlike many other occasions, where the germans had practiced a scorched earth policy during their withdraw from the territory of soviet union, the devastation was caused directly by the hostilities. After the war Ternopil has been rebuilt in a typically soviet style. Only a few buildings have been reconstructed.
Since 1991 Ternopil is a part of independent Ukraine and along with other cities of Halychyna is an important center of Ukrainian national revival.
After the second partition of Poland, Ternopil came under Austrian domination and Joseph Perl was able to continue his efforts to improve the condition of the Jews there, which he had begun under Russian rule. In 1813 he established a Jewish school which had for its chief object the instruction of Jewish youth in German as well as in Hebrew and various other branches. Controversy between the traditional Hasidim and the modernising Maskilim which this school caused resulted four years later in a victory for the latter, whereupon the institution received official recognition and was placed under communal control. Since 1863 the school policy was gradually modified by Polish influences, and very little attention was given to instruction in German. The Tempel für Geregelten Gottesdienst, opened by Perl in 1819, also caused dissensions within the community, and its rabbi, S. J. Rapoport, was forced to withdraw. This dispute also was eventually settled in favor of the Maskilim. As of 1905, the Jewish community numbered 14,000 in a total population of 30,415. The Jews were engaged principally in an active import and export trade with Russia through the border city of Podwoloczyska.