Carlos Martins and Hugo Almeida scored one goal each and Helder Postiga scored twice for Portugal to mark a historic victory over the the World Champions.
The friendly match was conducted to promote the neighbors" joint bid to host the 2018 World Cup.
Spain started the game with 10 players from their 2010 World Cup final squad. But the attractive game from Portugal players, especially by Real Madrid star Christano Ronaldo and Nani, who celebrated his 24th birthday, uprooted the FIFA Champions.
Carlos Martins scored the first goal at 44th minute by netting a rebound ball. Second goal came in 48th minute Helder Postiga by acrobatic back-heel shot.
Postiga scored the third goal in 67th minute and the final goal came in 69th minute by Hugo Almeida.
"We have no excuses. We allowed them too much space. We could not have played worse," Spain coach Vicente Del Bosque said after the match.