The town was founded by Adam Olbracht Przyjma-Przyjemski for Protestant refugees from Silesia during the Thirty Years War. In the 1800s, it contained a Protestant church and a medieval town hall. The principal industry was the manufacture of snuff and cigars. Trade involved grain, wool, cattle, hides, and timber. In 1905 it had 11,403 inhabitants. A large prison exists in former monastery since 1820. After World War I the town became part of the Second Polish Republic.