A penalty shootout began Spain's era and a penalty shootout could have ended it. Instead, the dream of a unique treble is still alive. A 0-0 draw and penalties with Italy in the quarter-final of this competition four years ago was the turning point, a game that changed Spain's history and changed their future. The man who scored the decisive penalty that night: Cesc Fábregas. On Wednesday night he again stood over the spot after 120 minutes had failed to yield a goal.

Fábregas had been down to take the second penalty but he had talked Vicente del Bosque into letting him take the fifth, admitting that he had a feeling hours before the game that this moment would come. "He told me that he wanted to take the fifth because he was going to give us the victory," the Spain coach said. Now the midfielder talked himself through the moment, convincing himself that he could do it again. And then he ran up and scored, the ball flying into the net off the right-hand post to send Spain into a third successive final.

"Being in another final is a miracle, it's very emotional," Fábregas said of the meeting on Sunday with Germany or Italy, who play on Thursday night. "I had a funny feeling about the penalties and I was thinking about them this afternoon. That life has given me another chance like this is really incredible. When I stepped up to take the penalty I said to the ball that we had to make history and it shouldn't let me down. They told me initially to take the second one but I said no, give me the fifth as I had this premonition."

What Fábregas experienced, Cristiano Ronaldo could not. He was in line to take Portugal's fifth and, he had hoped, decisive penalty. He did not get the chance. Xabi Alonso had seen his penalty, Spain's first, stopped by Rui Patrício but Iker Casillas then saved from João Moutinho.

When it came to the fourth for each country, Sergio Ramos, who had blazed high over the bar in the Champions League semi-final shootout, clipped in a la Pirlo. "It seems to be fashionable now," Del Bosque said. "I was delighted with it." Bruno Alves then thumped his off the underside of the bar and away. As the ball bounced free, it took Portugal's chances of reaching the final with it.

Fábregas scored. Spain had made it. Not the way they would have liked, not without a scare, but they had made it. "The players have played so many matches and they have to show their best in one more," Del Bosque said. "It was a very even match but maybe we were a little better in extra time. They looked a bit tired, but there were few chances before that. It wasn't easy to get through their defence."

This was indeed a game that offered little but tension until extra time when Spain finally created the chances that had evaded them before. Portugal broke from the normal mould employed by those that face the world champions, pressing where others sit, and for a time could feel entitled to the victory. What few opportunities they created, though, were wasted on a night when the ball seemed to be forever flying over the bar and into the stands. Hugo Almeida was particularly ineffective. So too Alvaro Negredo, the striker surprisingly chosen to start for Spain.

An image of Spain's difficulties came with a small inquest by the touchline during a break in the play half an hour in. Spain were struggling to get fluidity, pushed back, under pressure. Andrés Iniesta had curled over the top and the best chance fell to Alvaro Arbeloa, racing into the area in the opening 10 minutes and side-footing over, but the discomfort felt by the Spanish was clear. Raul Meireles and Moutinho had rarely allowed them to settle while Nani and Ronaldo forced them back, the threat always latent.

Del Bosque decided to make a change. The second half was not even ten minutes old when Negredo was withdrawn for Fábregas. Less punch perhaps but more possession. Time to claim back the control that Spain had, for once, lacked. It took a while to arrive though – it would not be until extra time that Spain looked dangerous. And by then, Pedro Rodríguez and Jesús Navas had both come on, to open up the pitch and give pace and incision. Until then a game that had begun with pace and intensity, the ball moved swiftly, had instead become disjointed, labouring towards the full-time whistle.

Just before it got there, Portugal got the break that could have won it. Spain were suddenly wide open, Meireles leading the charge. Ronaldo roared up alongside him and received the pass. His shot was wild. It also went over. It was the story of the night until then. Extra time loomed.

So, perhaps surprisingly, did a different game; at last there was a chance worthy of the name. Pedro, on as a substitute and making a huge impact on the match, Jordi Alba and Iniesta had everyone running off the Spanish bench, seeing the final rear into view, only for the ball to drift agonisingly wide. Sergio Ramos then thumped in a free-kick with the last touch of the first half of extra time and in the 100th minute, there was another opportunity, the game's best. Arbeloa overlapped, pulled the ball back for Navas and his shot from just beyond the right-hand corner of the six-yard box was saved by Patrício. Next Fábregas sent Pedro racing through but as he cut inside, Fábio Coentrão smashed the ball clear. This was Spain's best period: for all the fatigue, they searched for the goal. Alba was screeching forward, Fábregas was involved, Pedro too was determined to run at opponents, Iniesta trying to move the team. Forward they went, at last, their minds were made: Spain wanted to avoid penalties.

They need not have feared. Fábregas stood on a familiar spot and took Spain to the final. It was, he said, "deja vu".