Alvaro Morata had given Spain the lead but Horta's goal ensured the great rivals drew for the fourth time in a row. Portugal have not won a competitive game against Spain since 2004 and have never beaten them on Spanish soil.
- ESPN+ viewers' guide: LaLiga, Bundesliga, MLS, FA Cup, more
- Don't have ESPN? Get instant access
Spain made a lively start in the League A Group Two match when midfielder Gavi had a chance from outside the box in the third minute but his effort was blocked.
Morata put Spain ahead from close range following a fine passing movement involving midfielders Gavi and Pablo Sarabia in the 25th minute.
The 29-year-old, hoping to play his first World Cup this year, is now three goals away from Raul's national squad record of 61 across all age categories.
"I think we played a good game, we weren't able to finish it off, but we faced a great national team with a lot of good players," Morata said afterward. "We have to keep working, we have games ahead of us."
"Football is like that. We had some chances, we didn't take them, and they equalised. We have to keep going and look forward."
Fernando Santos' side were once more close to levelling just before the hour mark after Leao received a pass from Silva and defender Diego Llorente failed to block his strike, but goalkeeper Unai Simon stretched to deny him.
Morata, meanwhile, had another good chance which went just wide of left post in the 64th minute before he was substituted.
Substitute Horta equalised for Portugal eight minutes from time, leaving the Spanish defence behind as he latched on to a precise cross from defender Joao Cancelo inside the area and placed a shot into the middle of Simon's goal.
Fans of both sides were able to enjoy a lively game which had caused the Spanish national team's website to crash when tickets went on sale last week.
The last positive result in the fixture was Spain's victory on penalties at the 2012 European Championship and their last two friendly meetings finished goalless.
Both sides play three more Nations League games in the next 10 days. Spain travel to Switzerland between two matches against the Czech Republic while Portugal host the Czechs and face Switzerland twice.
"We go into every game to win," Spain defender Cesar Azpilicueta said. "If we'd won today we'd have gone to Prague to win, too. We always try to play the same way independent of the result. We keep growing as a team, now we have to recover and prepare for Sunday's game."