Far from its best, Spain still advanced to another major final on Wednesday by beating Portugal 4-2 in a penalty shootout after a 0-0 draw at the European championship.
Cesc Fabregas, who came on as a substitute in the second half of regulation time, scored the deciding penalty after Bruno Alves had hit the crossbar for Portugal moments earlier.
"I played poorly, but the team worked really hard," Fabregas said. "I had this intuition that we could advance if we went to penalties and that's what we did."
Spain, which is trying to win a third straight major trophy after claiming titles at Euro 2008 and the 2010 World Cup, will next face either Germany or Italy on Sunday in Kyiv.
"Being in another final is a miracle," Fabregas said. "It's really incredible."
Cristiano Ronaldo had several chances for Portugal, but he sent three shots well over the bar as his team held its own for the entire match. The Real Madrid star, who came alive with three goals in his last two matches at Euro 2012, did not take a penalty in the shootout. He had been slated to take the fifth one, but he never got that far.
After an often dour opening 90 minutes in which the Spanish failed to impress, the match livened up in the 30 minutes of extra time. Spain midfielder Andres Iniesta forced Portugal goalkeeper Rui Patricio into a superb reflex save in the 103rd minute. Iniesta ghosted into the penalty area, then held his head in disbelief as Rui Patricio reacted brilliantly to get a strong hand to his shot after Jordi Alba cut the ball back toward the penalty spot.
Rui Patricio made another fine save to deny substitute Jesus Navas in the 111th.
Tempers frayed at times, with Portugal centre half Pepe getting a yellow card for a challenge on Xabi Alonso as they went for a high ball. Ronaldo also received some heavy challenges late on.
In the shootout, Xabi had the first attempt saved by Rui Patricio. But Spain goalkeeper Iker Casillas then saved Joao Moutinho's shot. Iniesta, Gerard Pique and Sergio Ramos then all scored for Spain, while Pepe and Nani scored for Portugal.
"The first one wasn't so lucky, and then we scored the rest of them," Casillas said. "Yes, we really were lucky. Everything is about luck sometimes."
Spain coach Vicente del Bosque ditched his unorthodox 4-6-0 formation for Wednesday's match and opted for a traditional striker — but not the one many expected. Instead of Fernando Torres, it was Alvaro Negredo that got the start up front. But 10 minutes into the second half, Del Bosque took him off and replaced him with Fabregas.
Although Negredo worked hard, his lack of movement made him easy to mark. Spain improved as Fabregas made clever runs to stretch the defence and the defending champions dominated most of extra time with the addition of Pedro Rodriguez late in the match.
Rui Patricio was a big help in goal for Portugal, but much more was expected from Ronaldo. The winger had a chance, albeit a difficult one, to win the game in the 90th minute when Portugal poured forward after clearing a free kick. But Raul Meireles' pass was fractionally behind Ronaldo and, with momentum lost, he had to check his run and sent his shot high and wide.
Ronaldo briefly threatened early in the first half, whipping over a cross from the left wing that Casillas grabbed before Nani could head it in. He also sent a free kick into the wall after too easily tumbling under a challenge.
Working as a unit, Portugal started to gain the upper hand midway through the first half. Moutinho flicked the ball into the path of Ronaldo, whose wild shot flew over.