Spain left it late but managed to secure a last-gasp win over Portugal to seal their spot in the final four of the Nations League joining Italy, the Netherlands and Croatia in the next year’s competition.
Alvaro Morata scored the only goal of the game in the 88th minute to take Spain top of League A-Group 2 on 11 points from six games, one point above second-placed Portugal who only needed a draw to secure a spot in the semi-finals at home.
Armed with the knowledge that a draw will be enough to ensure progress, Portugal dominated the visitors in the early period of the game who came into the contest on the back of a surprise defeat.
Diogo Jota and Bruno Fernandes went close to scoring but Unai Simon kept Spain in the contest with a couple of brilliant saves.
The second half was started in a similar fashion with Simon denying Cristiano Ronaldo the opener after Portugal found a way through their defence once again. With time ticking down Luis Enrique decided to call upon his substitutes which changed the game.
Pedri, Nico Williams, Sergio Busquets and Gavi all wrestled the control back towards Spain as they began to dominate more and more.
Alvaro Morata eventually scored the winner in the 88th minute when he was set up by Williams with a perfectly placed headed pass which the forward dispatched with ease. There was little time left on the clock for Portugal to respond as they missed out on a chance to add their second Nations League trophy.
Their Nations League win also happens to be the first for Spain against Portugal in their home since a 2003 friendly win.
Both the countries will now turn their attention to the FIFA World Cup in Qatar.