Mikel Merino's stoppage-time winner sent Spain through to the quarter-finals and brought a bittersweet end to Cristiano Ronaldo's final World Cup dance. Photo: AFP

Substitute Mikel Merino scored a late winner to put Spain into the quarter-finals with a 1-0 victory over Portugal and end Cristiano Ronaldo's Fifa World Cup career on Monday.

The European champions will face the US — the only one of the co-hosts remaining — or Belgium on Friday in Los Angeles.

In front of an expectant crowd of 70 649 at the air-conditioned home of the Dallas Cowboys, a match that on paper promised so much failed to really deliver. Extra-time looked certain, before fellow substitute Ferran Torres slipped in Merino to settle the contest in the first minute of injury time.

It meant a sour final World Cup match for the 41-year-old Ronaldo, now playing in Saudi Arabia, having confirmed on the eve of the encounter that this would be his last dance on football's biggest stage.