King Zygmunt II expanded the hunting lodge into a royal palace, where his mother Queen Bona Sforza temporarily lived after the death of her husband Zygmunt I. From 1620 to 1624 Zygmunt III. expand Matteo Castello's castle into a baroque fortress with a square courtyard. During the Battle of Warsaw in July 1656, the castle served as the headquarters of King Charles X Gustav of Sweden. After his departure, the king and Carl Gustaf Wrangel had the castle plundered and the building details dismantled and shipped to Sweden, where they probably never arrived.[2] In 1683 Crown Marshal Lubomirski acquired the palace and had it remodeled. One of the architects involved was Tylman van Gameren. The last Polish king, Stanisław August Poniatowski, acquired the castle in 1764 and transferred the property to the city of Warsaw in 1784. The castle and its ancillary facilities initially served as barracks and then as a military hospital for almost 150 years until the Second World War. It was set on fire by the Wehrmacht during the German occupation of Poland, and 40% of it was destroyed. It was not rebuilt after the war, but its remains were demolished in 1954 by order of the then Marshal Rokossovsky. The Polish Army Theater was to be built in its place. Only in 1975 was it reconstructed in the original, early Baroque style.