Spanish midfielder Cesc Fabregas (L) scores the winning penalty
Spain reached their third consecutive major tournament final after overcoming neighbours Portugal 4-2 on penalties in the first Euro 2012 semi-final in Donetsk.
After an attritional game finished 0-0 following extra time at Donbass Arena, Cesc Fabregas swept home the winning spot-kick to put Spain in the final.
Xabi Alonso and Joao Moutinho both saw their opening penalties saved, but Portugal blinked first when Zenit Saint-Petersburg centre-back Bruno Alves slammed his side's fourth penalty against the crossbar.
Fabregas stepped up and, just as he had done in the penalty shootout win over Italy in the Euro 2008 quarter-finals, the Barcelona man held his nerve, steering the ball into the bottom-left corner to send Portugal home.
"We are so happy to have reached another final. I don't know if that has ever been done in history," Fabregas told Spanish television channel Telecinco, his voice cracking with emotion.
"They told me I was going to take the second kick, but I said: 'No, I want to take the fifth one.'"
Reigning world and European champions Spain, who are bidding to become the first team in history to win three major competitions in a row, will face either Italy or Germany in Sunday's final in Kiev.
"We were stronger in extra time, but overall it was a fairly even contest," said Spain coach Vicente del Bosque.
"It was tough. We took a while to get into our stride. The Portuguese were very well organised. Germany and Italy are equally strong."
It was a deeply disappointing end to the tournament for Portugal captain Cristiano Ronaldo, who had threatened to fire his side into only their second major final but who did not even get a chance to have his say in the shoot-out.
"If I had to choose a way of losing, I wouldn't choose this," said Portugal coach Paulo Bento.
"But you have to lose some way. Spain are a great team and we can leave the pitch with our heads held high."
A surprise inclusion in Spain's starting line-up, Alvaro Negredo was at the source of the game's first chance, with Alvaro Arbeloa side-footing over after the Sevilla striker was crowded out in the Portuguese area.
Portugal's match-winner against both the Netherlands and the Czech Republic, Ronaldo was a spectator in the first 10 minutes, but gradually his influence grew.
After fluffing a free-kick into the base of the wall from a tight angle on the left, he lashed a half-volley high over the crossbar from the edge of the area and then drilled a left-shot narrowly wide of the right-hand post.
As in the quarter-final win against France, Spain struggled to find holes in their opponent's defence, and it was a surprise to see Alonso club a long ball forward in the 29th minute.
It produced a sight of goal, however, with Andres Iniesta bending a shot narrowly over the bar after Negredo had chased down Alonso's pass, held off Fabio Coentrao, and worked the ball back to the edge of the area.
The snap in Portugal's tackles was helping them establish a presence in the Spanish half and with Negredo failing to provide enough of an outlet for Spain, it was no surprise to see him replaced by Fabregas early in the second half.
Del Bosque introduced Jesus Navas in place of David Silva, before Xavi worked Rui Patricio for the first time in the match with a speculative effort that found the Portugal goalkeeper's midriff.
Ronaldo had a fine opportunity to snatch a winner in the last minute of normal time but he could only shoot over from Raul Meireles' pass, prompting mocking cries of 'Messi! Messi!' from the Spain fans.
A succession of late flare-ups gave the game added spice going into extra time, and after a watchful opening, Spain finally began to show.
Shortly before half-time in the extra period, Iniesta drew the first real save of note from Patricio after ghosting into the box to meet Jordi Alba's cut-back.
Sergio Ramos then sent a free-kick whistling over the bar, while Navas tested Patricio early in the second half after wriggling down the inside-right channel in the Portuguese box.
Fabregas sent fellow substitute Pedro Rodriguez clear with seven minutes left but he delayed, allowing Coentrao to clear, and the time for penalties had arrived.