Ukraine proved far too strong for San Marino as they hit eight goals in Serravalle, including a Marko Dević hat-trick, but it was not enough for Mikhail Fomenko's men to top FIFA World Cup qualifying Group H.
With England posting a 2-0 success against Poland, Ukraine ended the qualifying campaign one point off the pace and must settle for a place in the play-offs. Yevhen Seleznyov struck twice, while Andriy Yarmolenko, Roman Bezus and Vitaly Mandziuk complemented Dević's treble with goals of their own. San Marino finished the night with nine men following the sendings-off of Mirko Palazzi and Alessandro Della Valle.
The Ukrainian breakthrough came in the 13th minute as Seleznyov registered from the spot after Dević was felled in the area. The foward then got the first of his three two minutes later with a low strike into the corner from Yarmolenko's ball, and on 19 minutes it was 3-0 as Seleznyov nodded his second.
San Marino prevented further damage before half-time but Dević powered in a header on 51 minutes, Yarmolenko notched the fourth four minutes later, and FC Metalist Kharkiv ace Dević converted from the penalty spot in the 58th minute to complete his hat-trick. Substitute Bezus was the next name on the scoresheet before Mandziuk rounded things off with his head in the last minute.