Spain defeated Belgium 2-1 in a dramatic World Cup quarterfinal to set up a semifinal clash with France.

Mikel Merino scored the decisive goal in the final minutes, firing home a loose ball after Belgian substitute goalkeeper Senne Lammens spilled a long-range shot.

Spain had taken an early lead through Fabián Ruiz. Belgium equalized with a Charles De Ketelaere header before halftime. The match appeared destined for extra time until Merino's late intervention.

Spain will face France in Dallas on Tuesday for a place in the final.