In the first international game with fans in attendance in Spain since the onset of the COVID-19 pandemic, the 15,000 in attendance thought they had seen Spain fall behind when Jose Fonte's looping header beat Unai Simon after 23 minutes, however, his looping header was ruled out for a foul on Pau Torres.
After struggling early on, the hosts were much better after the restart, with Alvaro Morata and Pablo Sarabia both missing chances.
Portugal were indebted to keeper Rui Patricio, who denied Ferran Torres from close range with two minutes remaining, before Morata hit the bar in stoppage time as Luis Enrique's side pushed for a late winner to no avail.
"We wanted to win, but it wasn't to be. We did some very good stuff and we'll take that away with us," defender Jose Luis Gaya told Spanish television.
"There's room for improvement, but all sides have things to improve before the tournament.
"Maybe we need to get better at set pieces, which is where Portugal are really strong, but the reality is we had the best chances to win the game."
The game saw French-born defender Aymeric Laporte make his debut for Spain, calling it a "privilege" to be playing international football with La Roja.
The former Athletic Bilbao man was granted Spanish nationality last month and was eligible to play for his adopted nation having not made his senior debut for the France national team, despite making 24 appearance for various age group squads.
"It's a privilege to be here with Spain," he told television channel La 1. "We didn't get the result we wanted, but we fought well and worked hard.
"Everyone knows Portugal are great team with some top players. It's a training game that serves us well for the future.
Laporte's nationalisation was a bone of contention in both countries, with France coach Didier Deschamps accusing the Manchester City man of lying about a supposed conversation they had.
However, the centre-back would not be drawn on the situation.
"The whole thing [being naturalised] is a really long story and I'd have to be here for an hour explaining it," he said.
"But the important thing is that I'm here, and hopefully this will be the first cap of many."
Spain face Lithuania in their final warm-up fixture on Tuesday before the Euros kick off next Friday.
Portugal host Israel on Wednesday before they start the defence of their Euro title.