The city was established in 1696 by Władysław Sokołowski, who brought there Bernardines, founded a church and a monastery.