The region around present-day Lviv stood under the influence of West Slavic tribes in its early history, followed by a period in the 9th century, when Polish rulers took control of the area, although that appears to have been contested by the Kievan Rus which had come into existence in the late 9th century. The king of the Rus, Daniel of Galicia (also known as Danylo Romanowych), built a castle for his son Lev here in 1256 - a signal that set off development of early Lviv. The town quickly grew in significance as it was located along main trade routes, but soon thereafter it fell victim to the Tatars, who on orders of the Mongol leader more or less destroyed the entire city.
Lev, who had taken over his father’s crown in 1269 and had become Leo I of Galicia, decided to rebuild the city in 1270. He subsequently relocated to Lviv himself and made the town the capital of Galicia-Volhynia. After several changes in control of the region, it fell to King Casimir III of Poland in 1340, who had to fight local noblemen who had attempted to prevent him from taking over control of Lviv. The city from then on remained a part of Poland ir Poland-Lithuania for a long time, only shortly interrupted by a time of Hungarian rule. In that time, it was mostly referred to as “Lwow”, became an important seat of the clergy and assumed a pivotal role in trade between the Black Sea area and the Baltic. In the 17th century, Poland-Lithuania was repeatedly attacked and Lviv frequently came under siege. The Cossacks, Swedes, Transylvanians, Turkish and Tatars all attempted to take the city but were repelled by the king’s troops, until it fell to the Swedes in 1704 in the Great Northern War.
In 1772, under Habsburg rule, Lviv became the capital of the Austrian kingdom of Galicia, under the germanized name of Lemberg. Despite the name, the city gradually became more Polish, a trend the Habsburg administration attempted to counter by bringing in German influences in all levels. This however led to discords in the population and finally to an uprising against the Austrian rulers in 1848, like in many other places of the Empire. In subsequent years, Galicia slowly received a level of autonomy and, while still a part of Austria-Hungary, developed a distinctively unique culture, distancing itself from German influences. Lviv made the most of these opportunities and became one of the largest and most important cities of the Empire with beautiful architecture and a liberal atmosphere.
The city shortly fell into the hands of Russia at the beginning of World War I following the battle of Galicia but after being recaptured remained in Austrian hands until the end of the war. The end of World War I however did not bring peace to the region, as the Ukrainian population quickly declared a Western Ukrainian People’s Republic with Lviv as its capital, while Poland, based on a Polish majority in the city, also laid claim on the region. The Poles started an uprising and quickly gained hold of the town. Afterwards, in November 1918, they conducted a pogrom against the Ukrainian and Jewish population of Lviv, resulting in the violent deaths of more than 50 people and the arrest of hundreds of others.
The aftermath of World War I saw much of Eastern Europe slide into turmoil with several states trying to seize the opportunity to realign borders and expand their areas of influence. In February 1919, Polish and Soviet Russia’s troops clashed for the first time, the starting point of the Polish-Soviet War that lasted until 1921 and caused many casualities in Lviv. At the end however, the Russians retreated and Lviv remained Polish. In the following years, the government sought to cement Polish rule over the area, especially by replacing the use of the Ukrainian language with Polish. In 1939, Nazi Germany invaded Poland to start off World War II. They reached Lviv in early September and besieged the city but were soon replaced by Soviet troops. The city remained under Soviet control after Hitler and Stalin essentially divided Poland among themselves. This set off a nightmarish time for Lviv and its residents. First, they welcomed the promised protection from the Soviets, but soon had to learn that thousands of Poles and Jews would be deported from the city immediately after they took over. Then, in 1941, the Nazis pushed back into town and again, parts of the population welcomed them as saviors from the brutal Stalin regime. The Germans however, supported by parts of the Ukrainian population sent the Jewish population into a designated ghetto and from there on to concentration camps or killed them on the spot. It is estimated that some 6000 Jews were killed in Lviv, with the rest of the Jewish community which had once numbered almost to 200,000 being transported to the gas chambers. The Ukrainian population, initially eager to pledge support to the invaders, learned within a few weeks that the Germans were not going to recognize independent Ukrainian state that Stepan Bandera and others had proclaimed upon the Nazi’s arrival. Instead, some of these nationalist activists were sent to concentration camps as well while others went underground and continued to fight against all foreign forces in the city with guerilla tactics.
After the war, Lviv became a part of Ukrainian Soviet Socialist Republic. While the Polish residents either fled or were forced into Poland, many Ukrainians settled in town. The Soviets placed some industry in the city including automotive factories, some of which were transferred from other parts of the country and also brought in a significant number of Russian residents. Towards the end of the Soviet Union, the region established itself as a center of a movement seeking more Ukrainian self-rule instead of the Russian-influenced government in Moscow. It has remained a center of Ukrainian culture to this day and has also been a hotspot of both the 2004 and 2014 Ukrainian revolutions.