The name Montemagno is vulgar for Mons Ianus, Latin for Monte Giano, dedicated to the Roman god Janus (from whom we have the word January).
The village is first mentioned in a charter of the Abbey of San Savino [Wikidata] in the year 780.
In 1021 walls were erected around the village, but S. Martino was a few hundred meters away and left out.
It was erected in 1632 by the 90 grateful surviving inhabitants after the plague in 1630 took 272 lives in the village.
On 15 February 1145 Pietro Bernardo Paganelli from Montemagno was elected the 167th Pope.