honour of Saint Hedwig, the High Duchess consort of Poland and patron saint of Silesia. Now designated a co-cathedral, it is the oldest building in the city. A wooden castle near the city, built ca. 1272, was the residence of Duke John of Ścinawa from 1358 to 1365. Janusz had ceded his lands to Duke Henry V of Iron. In 1477 the town defeated a 5,000-strong army from neighbouring Brandenburg which attempted to seize it during the succession war to the Duchy of Głogów. In 1488, Duke John II of Żagań, destroyed the castle to prevent his enemies from using it. The deposition of Duke John II of Żagań in 1488 marked the end of the long rule of the Piast dynasty in the Duchy of Głogów and the city of Zielona Góra. Later on, the duchy was ruled by the future Kings of Poland John I Albert and Sigismund I the Old. It was integrated with the Kingdom of Bohemia in 1506, although Polish king Sigismund I the Old still claimed his rights to the city in 1508. The city flourished during the reign of Sigismund I the Old. In 1505 Sigismund issued a privilege allowing the sale of cloth products from Zielona Góra throughout Poland. In 1641, King Władysław IV Vasa of Poland confirmed these rights. Another important branch of the city's economy at this time was winemaking. The city converted to Lutheranism during the Protestant Reformation through the efforts of Paul Lemberg, Abbot of Sagan. The city declined during the 17th century, especially during the Thirty Years' War (1618–48) and following decades. Grünberg endured plundering, debts, emigration of burghers, and fires. In 1651 during the Counter Reformation, the Habsburg monarchy of Austria reintroduced Roman Catholicism and suppressed Protestantism. The city was subjected to heavy Germanisation and German craftsmen banned Poles from attending any practice allowing them to work as members of guilds. A rebellion caused by conscription ended with many Poles being imprisoned. From 1640, witch trials took place, the number of which increased significantly in 1663–1665. As a result, in 1669 the local court was deprived of the right to impose the death penalty on women accused of witchcraft. The city was annexed by the Kingdom of Prussia by the 1742 Treaty of Breslau which ended the First Silesian War. The Prussians introduced religious toleration, leading to the construction of the Protestant parish church Zum Garten