Pedro Neto provided an assist in a 2-2 draw with Spain before Portugal went on to win the UEFA Nations League trophy 5-3 on penalties.
Spain boss Luis de la Fuente named Marc Cucurella in his starting lineup, while Pedro Neto got the nod for Portugal with Renato Veiga and Joao Felix named on the bench.
It was Spain who struck first after 21 minutes thanks to Martin Zubimendi, but their opponents hit back almost immediately. Some smart play on the left wing from Neto made space for an insightful pass to Nuno Mendes, who made an explosive run into the box and smashed his left-footed shot beyond Unai Simon.
Mikel Oyarzabal put Spain back in front on the stroke of half-time, but Portugal were level once again when Cristiano Ronaldo popped up at the far post to make it 2-2 with an hour gone.
Veiga was introduced after 74 minutes, replacing Goncalo Inacio as both sides looked for a winner before facing the prospect of extra time.
Cucurella intervened with a couple of crucial defensive headers in the final stages of the game. Neither side could find the crucial breakthrough before the end of the 90 minutes.
Neto was sacrificed for Diogo Jota during the break in extra time, but the score ultimately remained locked at 2-2 and the final went to a penalty shoot-out.
Alvaro Morata missed Spain's fourth penalty and Ruben Neves stepped up and converted the winner for Portugal.
Earlier in the day, Malo Gusto started for France in their Nations League third-place playoff against Germany. Kylian Mbappe scored his 50th international goal as Didier Deschamps' side took a 1-0 lead just before half-time.
Mbappe set up Michael Olise in the 84th minute to make it 2-0 as Gusto helped France see out the win to finish in third place.