 In 1706/1707 it was chosen as a residence by Stanisław Leszczyński, who had been elected anti-king to Augustus the Strong.Later in the 18th century the castle housed the regional court of law, a prison and apartments for officials.Beginning in 1798, the local Mirus family had a romantic park constructed around the castle, which is notable for its artificial ruins and a rock tunnel built in 1866.