The Young Dragons had suffered a humiliating 1-0 defeat in San Marino last month but they made no mistake on home soil as Ellis Harrison, captain Lee Lucas, Wes Burns and Billy Bodin all found the net.
The win puts Wales at the top of Group 1 for at least a few hours ahead of Finland and England's fixtures on Tuesday evening, although they have played more games.
Wales made a bright start with Burns and Tom Lawrence, who grabbed both goals in Friday's win over Lithuania, going close early on, but it took until just before half-time for Wales to make their dominance tell.
Bristol Rovers' forward Harrison was on hand to finish superbly from a Morgan Fox pass in the 44th minute to give the hosts the interval lead.
Their advantage quickly double five minutes into the second half as Swansea midfielder Lucas despatched a magnificent 30-yard strike beyond Massimo Francioni in the San Marino goal.
Burns made it 3-0 in the 64th minute as he calmly slotted home after racing onto Scott Tancock's long ball, before Bodin completed the rout after San Marino had failed to clear his initial corner.