Historically situated in the eastern Polish–Lithuanian Commonwealth, following the 18th-century foreign partitions it was annexed by Russia (except for its southern part, including Lviv, which was taken by the Habsburg Monarchy) and ceded back to Poland in 1921 after the Peace of Riga.