Margonin dates back to the 7th century, and in the 9th–12th it was a defensive stronghold, which became part of Poland after the establishment of the state in the 10th century. Margonin was first mentioned when Archbishop Jarosław Bogoria of Skotniki of Gniezno and the Bishop of Poznań, Jan Doliwa, agreed on May 15, 1364 that Margonin parish should belong to the Diocese of Poznań. Town rights were received in 1402. Margonin was a private town of Polish nobility, administratively located in the Kcynia County in the Kalisz Voivodeship in the Greater Poland Province of the Polish Crown. Much of the town was destroyed in 1655 during the Swedish invasion of Poland ("Deluge"), and the town lost its rights. They were restored on July 20, 1696. An orphanage was established in 1725. The Catholic Church was heavily damaged by a storm in 1737, and was repaired between 1753 and 1755.