Margonin is first mentioned when Archbishop Jarosław Skotnicki of Gnesen and the Bishop of Posen, Jan Doliwa, agreed on May 15, 1364 that Margonin parish should belong to the Posen Diocese. Town rights were received in 1402. Much of the town was destroyed in 1655 during the Polish-Swedish wars, 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. The area was included in the First Partition of Poland, at which time the area fell to Prussia, and was then part of the Grand Duchy of Posen until 1848, except for the Napoleonic period of the Duchy of Warsaw (1807 to 1815), and then part of the Prussian province of Posen until 1918. Gas lanterns illuminated the town from 1905. In 1908, the town was connected to the railway spur running between Gollantsch and Kolmar. From 1920 to 1939, the area was part of Poland. During World War II, the town was under German occupation from September 5, 1939 to January 22, 1944, the area having been made part of the Wartheland. Following World War II, the area reverted to Poland. In 1975 the town became part of the Piła Voivodeship, in 1998 part of the Greater Poland Voivodeship.