 Upon the First Partition of Poland in 1772 it became part of the Austrian Kingdom of Galicia.After World War I and fall of Austria-Hungary it became part of Poland.It was annexed by Nazi Germany at the beginning of World War II, and afterwards it was restored to Poland.