The city's history began when Polish Duke Henry the Bearded brought first settlers to the area in 1222. In 1323 Zielona Góra was granted town privileges. The town was incorporated into the Kingdom of Bohemia in 1506. As part of Bohemia, in 1526 it became part of the Habsburg Empire and experienced a wave of witch trials in the 17th century. As a result of the First Silesian War, the city was annexed by Prussia and, in 1871, became part of Germany, until the end of World War II in 1945. In accordance with the Potsdam Agreement, the province was handed over to Poland and resettled with Poles, most of whom came from Central Poland, but some also had been expelled from the Eastern Borderlands.