The quake struck near the city of Ravenna, in Emilia-Romagna, just after midnight.
It was followed by a magnitude-3 aftershock around 30 minutes later.
Many residents living in and around Ravenna fled their homes fearing buildings would collapse.
The tremors were also felt in Bologna, and as far away as the neighbouring regions of Veneto and Le Marche.
No casualties were reported and only minor damage was detected.
Ravenna ordered schools and universities to remain closed on Tuesday while authorities checked buildings for any further damage.