England were living on the edge and Spain could have been out of sight as Ferran Torres saw a goal ruled out for offside, forced a fine save from Trafford, then rolled a finish wide when clean through.
When England finally adopted a more direct approach, it reaped rewards as they turned the game on its head to lead before the break.
The excellent Gordon raced clear to beat Spain goalkeeper Unai Simon with a cool finish after 36 minutes before Kane added England's second four minutes later as his header was deflected in off Marc Cucurella.
England suddenly had Spain in retreat, but wasted a huge opportunity to extend their advantage after 55 minutes when a penalty was awarded for Rodri's foul on Bellingham after a Video Assistant Referee intervention.
Kane, normally so reliable, slipped as he went to take his kick, actually touching the ball twice before hitting the bar.
Once again, it was an error that undermined England as Spain equalised on the hour. O'Reilly was the culprit on this occasion, losing possession before substitute Baena beat Trafford low down from the edge of the area.
Spain had regained their composure and also regained the lead with 16 minutes left, a slick move finished by Oyarzabal - who scored the winner against England in the Euro 2024 final - lifting a delicate finish over Trafford.