|This article does not cite any sources. (January 2010) (Learn how and when to remove this template message)|
The name of the modern borough comes from the original village that was founded there in 1423 on German law. The right to locate a village there was granted to certain Stechar and Johann Sommerstein. The latter gave his name to the settlement of Sommersteinshof. With time the name got polonized to Zamarstynów, a name that ultimately became also ruthenized (ukrainianized) to the modern "Zamarstyniv". Until the 16th century the village belonged to the city of Lviv (then called Lwów) as one of its suburbs. It was not until 1615 that the city finally repaid its debts and Zamarstyniv once again became municipal property. Surrounded by rich turf deposits, Zamarstyniv also provided the nearby city with wood, fruits and vegetables. However, it was pawned to one of the burghers (Zebald Worcel), who in turn sold it in 1567 to Mikołaj Sieniawski, a notable member of the Polish-Lithuanian gentry, magnate and the Field Hetman of the Polish Crown. On February 11, 1695 the village was pillaged by the Tartars, who burnt to the ground a local manor belonging to one of Lviv's counsellors Dominik Wilczek.
Following the partitions of Poland the village, along with the rest of Galicia, became part of Austria-Hungary. By then the demand for turf dwindled and Zamarstyniv's residents became impoverished. No longer able to provide the town with goods, the village was sold into private hands in the early 19th century. Since then the settlement grew to become a residential suburb. In 1890 it had 3,379 inhabitants, including 3,257 Poles, 47 Germans and 44 Ukrainians.
During the Battle of Lviv of 1918 heavy fighting between Polish and Ukrainian forces took place in the vicinity of the suburb. The village ultimately ended up in Polish hands. It continued to grow and by the mid-1920s it had almost 12,000 inhabitants, including 6000 Poles, 3500 Jews and 2500 Ukrainians. Finally in 1930, it was directly incorporated into the nearby city of Lviv as one of its boroughs. Despite the population boom, the suburb retained its reputation of a borough of criminals and paupers for the rest of the 1930s. Out of newly erected buildings only three were worth being mentioned in a 1937 guide to Lviv: the Greek Catholic St. Paraskeva's church, the Roman Catholic St. Martin's church and a J. A. Baczewski vodka and liquor factory built there. Between 1934 and 1939, a large primary school was built there, as well as a large swimming pool. Around that time, the Polish Army also built a central military prison for south-eastern Poland, which was later converted by Soviets into a political prison.
Following the Soviet takeover of the city of Lviv after the Nazi-Soviet Pact and the invasion of Poland of 1939, the Soviets organised a political prison in Zamarstyniv. After the start of the German-Soviet war most of its inmates were murdered by the retreating NKVD. Following the German takeover of the city in 1941 a Jewish Ghetto was organised there. Out of more than 130,000 Jews incarcerated there, most were ultimately deported to concentration camps at Bełżec and Janów Lubelski and by 1943 the ghetto was completely liquidated.
After the war, the city became part of Ukrainian SSR and the Zamarstyniv suburb was rebuilt, this time mostly as an industrial area with some residential functions retained by the southern part of the borough. Since 1991, it has been a part of independent Ukraine.