Lukaku took his record Belgium international tally past 50 goals as Roberto Martinez's Group I leaders opened up an unassailable 11-point lead over third-placed Cyprus with three games remaining.
The world-number-one ranked side booked their spot at next year's tournament, which will be played at 12 venues across Europe, after seven straight qualifying wins.
Russia appear set to take the second automatic slot from the group, after a 4-0 win over Scotland moved them eight points ahead of Cyprus.
Belgium will be one of the favourites as they look to lift a first major international title when the Euros get underway on June 12.
Belgium were forced to wait until the 28th minute for the initial breakthrough on Thursday, which arrived when Leicester midfielder Youri Tielemans fed Lukaku, who fired home his landmark goal under San Marino goalkeeper Simone Benedettini.
The floodgates then opened, as Nacer Chadli slotted into the corner from the edge of the area three minutes later, and visiting defender Cristian Brolli scored a comical own goal 10 minutes before the interval as Benedettini pushed the ball against his knee and into the net.
Lukaku wasted little time in making it 51 Belgium goals with a low, right-footed effort, before Toby Alderweireld's deflected strike and Tielemans' drive made it six before half-time.
Substitute Christian Benteke drilled in number seven with 11 minutes remaining, 18-year-old Yari Verschaeren scored his first international goal from the penalty spot, and Atalanta defender Timothy Castagne completed the rout in the 90th minute.