Settlement in the Dobrzyń Land is dated as far back as 1065. The crusadingOrder of Dobrzyń was granted Dobrzyń as a base in 1228, although the knights were later incorporated into the Teutonic Order. The town was accorded city rights by the beginning of the 13th century, and Dobrzyń was the capital of a principality until the beginning of the 14th century. A castle was constructed by the Order of Dobrzyń, but it was destroyed in 1409 in a war with Poland. It was also sacked by Daniel of Galicia, who was King of Galicia in 1240.