The town was mentioned first in 1281 as Szentpéter (St. Peter). It got the first part of its name later, from the river Sajó. The town was owned by the king, it belonged first to the Castle of Diósgyőr, then to the Dédes estate. During the Hussite fights the town was destroyed. It was built again after 1466 but got its town status back only in 1989.
In the 17th–18th century the town was owned by several important noble families, among them the Rákóczi and the Losonczy families.
In the 19th century the formerly agricultural village became an industrial one, coal mines were opened and a glass factory was built. Being halfway between two of the largest industrial cities of the area, Sajószentpéter couldn't avoid being more and more industrialized during the Socialist era, but, like in other cities and towns of Northern Hungary, the industry faced a crisis after the Socialist regime fall, and unemployment became one of the largest problems.