Spain were much the better side in the first half, with Sergio Canales running the show in the midfield. However, after the break, Portugal asserted their influence on the game, and were unlucky to not score.
First Cristiano Ronaldo was unfortunate to hit the crossbar after a thunderous strike had easily beaten Kepa Arrizabalaga.
After that, Ronaldo set up Renato Sanches with an exquisite pass with the outside of his right foot, but the youngster slammed the crossbar too.
Joao Felix had a late chance for Portugal, but he could not make contact on Sanches's flick from a corner in the last minute of the game.
Here's how each player fared for both sides.
Portugal Player Ratings
Rui Patricio - 6/10
The Portuguese 'keeper had several saves to make in the first half, but none where particularly challenging, mostly from long range. He caught those shots with ease, while also making a superb save to deny Dani Olmo midway through the second half.
Joao Cancelo - 5/10
Cancelo didn't have the best of games here. He was not able to deal with the dribbling and passing of Olmo, and was not very effective in curtailing the impact of the RB Leipzig man.
Pepe - 7/10
The veteran was the best Portuguese defender on show. Because Spain got ball into the wide areas so often, Pepe had to defend a lot of crosses in the first half . He did so admirably, barely allowing Gerard Moreno even the sight of goal.
Ruben Semedo - 5/10
Starting alongside Pepe, Semedo was not quite at his best. he could not deal with the threat of Rodrigo coming in onto his left foot.
Raphael Guerreiro - 5/10
Like Semedo, Guerreiro had a problem with Rodrigo. As with most inside-forwards, Rodrigo did not hold the width of the pitch, and preferred to drift in-field. That led to confusion between Guerreiro and Semedo, who could not decide whether to stick with Rodrigo or pass him onto the next man.
Ruben Neves - 6/10
In a rare start for Portugal, Neves was very impressive, especially in the second half. He started winning tackles more often to get control of possession, which automatically helped Portugal play a better brand of attacking football in the second half.
Joao Moutinho - 4/10
Portugal really had no control of possession in the first half, and Moutinho was partly responsible for that. He was a bit too lightweight in midfield, and didn't do enough to close down the space for Dani Ceballos and Sergio Canales to work in.
Renato Sanches - 7/10
The youngster had a very impressive outing for Portugal. There were shades of the Sanches that the world saw at EURO 2016. He was desperately unlucky twice in the second half. Once, he hit the crossbar after a sensational Ronaldo pass, and he also set up Joao Felix with a great flick-header, but the Atletico Madrid man missed, depriving Sanches of an assist.
Cristiano Ronaldo - 8/10
A typical Ronaldo performance that could easily have ended in the superstar scoring his 102nd goal for his country. Instead, he watched on as the crossbar was rattled, and Kepa had another lifeline on his way to a clean-sheet.
Francisco Trincao - 6/10
Trincao should glimpses of what he is capable of at isolated points of the game. His next challenge will be to put all that together, and put defences under sustained pressure.
Andre Silva - 5/10
Andre Silva really didn't have too many chances to score, with the service into him being almost non-existent.
Ruben Dias - 6/10
The City new boy carried on from where Pepe left off in this game. Like Pepe, he was easily able to marshall Gerard Moreno.
William Carvalho - 5/10
After replacing Moutinho in midfield, Carvalho brought much-needed calm to the defensive structure, by being the deepest-lying midfielder himself. He did not have a great time with his passing though.
Bernardo Silva - 6/10
The Manchester City man continued his road to recovery with some more minutes under his belt.
Nelson Semedo - 5/10
After coming on a second-half substitute, Semedo was not having the happiest of games against the pace and power of Adama Traore.
Joao Felix - 5/10
He had a great chance to win Portugal the game, when an open goal looked him in the face. But he failed to make any contact with Renato Sanches's flicked header from a corner.
Diogo Jota - 6/10
The Liverpool man had a bright little cameo in this game. He could have also had the winner, with a sensational run to take him past the Spanish defence, but his shot was blocked.