England produced a superb display – their finest under head coach Thomas Tuchel – and survived a late siege to earn a landmark victory against World Cup holders Spain in Madrid.
Tuchel's side raced into a 3-0 lead before the hour, but they were then forced to mount a rearguard action after Elliot Anderson was sent off and Spain threatened to turn around a game England looked to have won.
James Trafford made a string of brilliant late saves to amply justify his selection and prevent an equaliser, ensuring England finished top of their Uefa Nations League group.
Home supporters inside the Metropolitano were stunned as England dominated from the first whistle to overpower a side who held a 43-game unbeaten record - setting aside their penalty shootout defeat by Portugal in the 2025 Nations Cup final.
Spain have won the European Championship and the sport's greatest prize since they last lost in regulation play in March 2024.
England had already wasted opportunities to make their vast superiority count before finally taking the lead on the stroke of half-time, captain Harry Kane scoring his 93rd international goal from the spot after he had been fouled by Pau Cubarsi.
Spain were on the ropes with England rampant as Tuchel's team added two more goals in quick succession after the break, Ezri Konsa heading in Declan Rice's corner after 53 minutes and Arsenal team-mate Ben White adding the third four minutes later when he crowned a sweeping move with a powerful angled finish.
England were then architects of their own troubles when Spain were thrown a lifeline after 65 minutes when Jarell Quansah was caught in possession, leaving Anderson to pull back Lamine Yamal.
Anderson was shown a red card, Mikel Oyarzabal scoring the resulting penalty.
Spain, so passive for so long, were suddenly inspired, with Lamine Yamal the catalyst. He was instrumental as they reduced the deficit further after 75 minutes, providing a perfect cross for substitute Nico Williams to beat Trafford.
Trafford then produced his heroics with a series of outstanding blocks and parries in a frantic finale as England closed out the win.
England back up Tuchel's bold words
England head coach Tuchel believed his side were in the mood to produce something special in Madrid. They did that and more besides on a magical night.
Tuchel's team had to show all sides of their character to overcome a Spain team who had almost become regarded as unbeatable, earning a win that was thoroughly deserved.
England were simply magnificent for the first hour as they raced into that 3-0 lead on the back of skill, strength and intensity that left Spain shell-shocked.
It was an advantage that flattered Spain rather than England, who showed no signs of sitting back to protect their lead against high-class opposition, as they had done with such a contentious outcome in the World Cup semi-final loss to Argentina in Atlanta in the summer.
Jude Bellingham, in particular, was simply irresistible as he gave a display stamped through with world class.
England were going in search of more goals, until the sloppy concession of a penalty and Anderson's dismissal left them to clear up a mess for the final 25 minutes.
Oyarzabal's penalty and a shot in off the left post from Williams looked to have given Spain unstoppable momentum, but this was when England dug deep with heroic defending and some superb work from Trafford, fully justifying Tuchel's faith in selecting him for such an exacting test.
Tuchel's elation at the final whistle was merited. He took the brickbats after the Argentina defeat, so here he could revel in a thrilling victory.