Portugal coach Carlos Queiroz admitted his side had been beaten by the better side after they had crashed out of the World Cup at the last-16 stage with a 1-0 defeat to Spain.
The Euro 2008 winners sealed victory thanks to David Villa's second-half strike, the first goal Portugal had conceded in the tournament.
At the group stage they had drawn 0-0 with both Ivory Coast and Brazil as well as thrashing North Korea 7-0.
After the match former Real Madrid boss Queiroz said:"Spain won with merit but I would also like to say that Portugal played with a great degree of dignity and ambition and I believe the fans have justifiable reason to be proud of the way the team has played.
"It was an extremely difficult game but Spain moved the ball very well and had more possession and any team that does that can control the game better.
"We did have opportunities to score but unfortunately we were not able to do so. We could have scored at certain critical moments, but Spain's victory is justified.
"We wanted to do well and, when we compete at this level, if we manage to obtain second or third, it is not satisfactory.
"Our main goal is always to win. We also want to have an honourable performance to dignify Portuguese football. I wanted us to be able to leave the field with our heads held high, and I think we accomplished this."