Cesc Fabregas was the hero again as Spain kept alive their hopes of defending the European title with a dramatic shootout win in Dontesk.
The Barcelona midfielder put Spain into Sunday's Euro 2012 final, drilling his penalty in off the left-hand post to spark scenes of jubilation.
Joao Moutinho and Bruno Alves missed for Portugal, with Cristiano Ronaldo a frustrated, unused fifth penalty-taker.
The match finished 0-0 after extra-time with neither side doing enough to win.
It took until half past midnight local time to get there, but Fabregas, who had scored the winning penalty in the Euro 2008 quarter-final win over Italy, ensured Spain proceeded to a final against Germany or Italy on Sunday and remain on course for an unprecedented third successive tournament victory.
The world champions have now won their past nine knockout games at major tournaments without conceding a goal, and their past 19 competitive matches.
Neither side had produced their fluent best during only the second 0-0 draw of the tournament. At times it was a bad-tempered affair and the apparently inevitable shootout made a nervy start as goalkeepers Rui Patricio and Iker Casillas denied Xabi Alonso and Moutinho respectively in the first round.
Andres Iniesta calmly put Spain in front, only for Pepe to keep Portugal on terms with a clinical low finish. Spain defender Gerard Pique found the bottom left-hand corner of the net, but Nani responded by firing his spot-kick high into the roof of the net to make it 2-2.
But when Spain's Sergio Ramos nonchalantly chipped his penalty beyond Patricio and Alves hit the bar for Portugal, it was left to Fabregas to send Spain into the final and spark memories of 2008 when their footballing history changed forever as a nation remembered how to win.
It had been billed as a clash of Ronaldo, the ultimate individualist, and Vicente Del Bosque's finely tuned orchestra - Ronaldo against Spain, Real Madrid against Barcelona, individual brilliance against the collective mastery of the defending world and European champions.
Ronaldo was a constant danger. But at no stage did Spain man-mark him, subject him to rough-house treatment or even cut off the supply from the excellent Moutinho.