Tin Jedvaj scored a last-gasp winner to revive Croatia’s hopes of reaching the Nations League finals as Spain fell to a 3-2 defeat in Zagreb.

The game was goalless until Andrej Kramaric tucked Ivan Perisic’s headed pass beyond David de Gea in the 54th minute. However, Spain responded immediately when Dani Ceballos recorded his first senior goal with a left-footed drive.

The Bayer Leverkusen defender Jedvaj got his head to a Luka Modric cross to re-establish Croatia’s lead but Spain’s captain, Sergio Ramos, levelled things up from the penalty spot after Sime Vrsaljko handled in the box.

Neither nation wanted a draw, which would have left the door open for England to take top spot with victory over Croatia at Wembley on Sunday, but Spain certainly did not want to lose. Three minutes into stoppage time Jedvaj found the back of the net when a saved shot rebounded to him.

Croatia will progress if they triumph in London, while any kind of draw will see Spain top Group Four. A goalless draw would send Croatia down and allow England to finish second.

Michy Batshuayi fired Belgium to the verge of the finals with his brace in a 2-0 home victory over Iceland. The Chelsea striker, on loan at Valencia this season, tucked Thomas Meunier’s pass away after the hour mark before making the three points safe in the last 10 minutes. However, Switzerland can still take top spot by beating Belgium in Lucerne on Sunday.

Austria’s goalless draw with Bosnia-Herzegovina in Vienna had the effect of promoting the Balkan nation and relegating Northern Ireland – who drew 0-0 with Republic of Ireland in a Dublin friendly – from Group Three of League B.

In League C, Willi Orban and Adam Szalai earned Hungary a 2-0 victory against Estonia, but the Magyars could not leapfrog Greece in Group Two as Angelos Anastasiadis’ men triumphed 1-0 against Finland thanks to Albin Granlund’s own goal in the 25th minute. The result denied Finland promotion on the night and they will go to Hungary in an anxious mood this weekend as Greece, who next host Estonia, retain an outside chance of catching them.

In League D, Latvia drew 1-1 with Kazakhstan as Deniss Rakels responded to Gafurzhan Suyumbayev’s first-half opener. Andorra moved third in their pool by drawing 1-1 with Georgia while Belarus beat Luxembourg 2-0 to leapfrog them into first in Group Two before a crunch trip to San Marino. Stanislav Dragun scored both the goals, either side of half-time. Vitalie Damascan rubbed salt into San Marino’s wounds following a miserable campaign by firing Moldova to a 1-0 win in Serravalle.