Daniel Sturridge's late header gave England a 1-0 win over Denmark after Kasper Schmeichel looked to have denied them victory at Wembley.
The Liverpool striker headed home Adam Lallana's inviting cross eight minutes from time to ensure England secured victory in their final game before Roy Hodgson names his provisional 30-man squad for the Fifa World Cup in Brazil.
Defeat was harsh on Leicester City goalkeeper Schmeichel, who produced a string of outstanding saves to keep the hosts out until Sturridge, who has 18 Premier League goals to his name this season, popped up with the winner.
Losses against Chile and Germany had put Hodgson at risk of becoming the only England boss to lose three consecutive home internationals, but the home side were not to be denied.
Denmark had their chances, but were ultimately unable to stretch their unbeaten run to six matches.
Glen Johnson won his 50th cap and was one of five Liverpool players in the England starting line-up, with captain Steven Gerrard, Raheem Sterling, Sturridge and Jordan Henderson making up the Anfield quintet.
Denmark were without key midfielder Christian Eriksen for their first game since long-serving coach Morten Olsen signed a new two-year contract.
Jack Wilshere's involvement looked like it may only last 13 minutes after he went down following a challenge from Denmark captain Daniel Agger, but the Arsenal midfielder was able to continue.
Casper Sloth was shown a yellow card four minutes later after he upended Gerrard as the midfielder charged towards the penalty area and the resulting free-kick was fired over by Wayne Rooney.
The lively Sturridge produced some lovely trickery before firing the ball across the face of the goal 32 minutes in as England continued to ask questions of the Denmark defence.
The visitors almost caught them out six minutes later, though, when Jakob Poulsen raced into the area and beat Joe Hart but Gary Cahill was on hand to clear.
Sterling somehow failed to convert the marauding Ashley Cole's inviting cross from point-blank range and then Schmeichel produced an outstanding save with his feet to deny Sturridge as Denmark weathered the storm late in the first half.
Teenage left-back Luke Shaw made his England debut as a half-time substitute to replace Cole, while Olsen brought on Kasper Kusk and Jesper Juelsgard at the break with Emil Larsen and Lars Jacobsen making way.
Juelsgard wasted no time in getting into the thick of the action as he whipped in a dangerous cross but Cahill was alert to the danger.
Gerrard had a shot deflected narrowly wide after 59 minutes, but it was not quite happening for England.
And they were indebted to Hart when the keeper raced out to narrow the angle and thwart Morten Rasmussen just three minutes after the striker had come on.
Danny Welbeck then brought another fine reflex save out of Schmeichel, who got down well to keep out a right-foot strike that looked bound for the net and the keeper denied the same player with a fine stop shortly after.
But Sturridge had the last laugh as he nodded home Lallana's fine left-footed cross to end England's five-month wait for a goal.
|Coach: R. Hodgson|
for A. Cole 46'
for J. Wilshere 59'
for W. Rooney 60'
for J. Henderson 77'
for R. Sterling 86'
for D. Sturridge 87'
for L. Jacobsen 46'
for E. Larsen 46'
for S. Kjær 62'
for C. Sloth 62'
for N. Bendtner 63'
for J. Poulsen 81'
|Moyes watches Sunderland win, Ibe opens account in six-goal Bournemouth thriller|
|Messi cuts short holiday for Barcelona training camp|
|Ranieri still confident of keeping Mahrez|
|Toure to complete Celtic move on Sunday, says Rodgers|
|Vietto sends Simeone a reminder amid Barcelona links|
|Celtic 1 Leicester City 1 (5-6 on penalties): Mahrez magic the highlight as Ranieri´s side triumph i|
|Ribery, Alaba on target in Bayern win|
|Neymar hails Micale ahead of Olympic tilt|
|Ronaldo wants Real Madrid renewal|
|Ochoa joins Granada from Malaga|
|Heidel quashes Meyer to Liverpool as ´nonsense´|
|Scholes challenges Allardyce to change England mentality|
|Tenerife star Crosas investigated for killing endangered shark|
|De Gea: Manchester United can win title under Mourinho|
|Marseille replace Batshuayi with brother Leya Iseka|
|Cristiano Ronaldo: Best season of my career|
|Scholes: Pogba is not worth £100million|
|Gotze has not forgotten how to play football - Riedle|
|Delph learning more than ever under Guardiola|
|Jovetic ´not worried´ about Juventus|
|Allardyce wants Euro 2016 woes to fire his England|
|Giggs not in a rush to take manager´s job|
|Lopetegui: If not for Spain I would be Wolves boss|
|Shaw one of best left-backs in world - Herrera|
|Injured Sanchez to miss Arsenal tour|
|Melbourne Victory 1 Juventus 1 (Melbourne win 4-3 on pens): Thomas inspires Victory as Juve pay pena|
|Janssen: Ajax and PSV were never going to pay as much as Tottenham|
|Bayern to make Munich shooting tributes|
|Wenger wishes luck to old foe Allardyce|
|United defender Varela joins Frankfurt on loan|
|Sunderland appoint Moyes as Allardyce replacement|
|Javi Martinez devastated by Munich shootings|
|Rooney: I´m desperate to play for Mourinho, just like under Ferguson|
|Godin: Champions League the dream, but LaLiga the focus|
|Klopp hails Wijnaldum´s ´football smartness´|
|Klavan ready to fight for starting spot after completing ´dream´ Liverpool move|
|Real Salt Lake 1 San Jose Earthquakes 1: Mulholland salvages point|
|Madeira airport to be named after Cristiano Ronaldo|
|Villar, Ceferin and Van Praag announce UEFA presidential bid|
|Witsel has offers from England and Italy|
|Tuchel will bring out Gotze´s best - Watzke|
|Swansea confirm interest in Liverpool´s Allen|
|Arsenal´s Coquelin: LeBron v Curry is like Messi v Ronaldo|
|Rooney backs Allardyce appointment|
|Bayern and Ancelotti respond to Munich attacks|
|West Brom friendly cancelled over violence concerns|
|Allardyce ´cannot stop smiling´ after getting England job|
|Rakitic dismisses Barcelona exit talk|
|Oxlade-Chamberlain salvages draw for Arsenal in opening friendly|
|Bruce leaves Hull City by mutual consent|
|Juventus start Serie A title defence against Fiorentina|
|Guardiola already making impact at Manchester City - Clichy|
|Liverpool sign Netherlands international Wijnaldum|
|Ranieri: Chilwell, Ulloa going nowhere|
|Batshuayi: Conte already making me a better player|
|Allardyce determined to be the best - Davies|
|Wolfsburg sign Mayoral from Real Madrid|
|New coaches the attraction in USA/Europe Champions Cup zone|
|´It was like F1 v F3´ - Mourinho not making hasty judgments on United squad|
|Suarez would welcome Vietto with open arms at Barcelona|
|Glenn hails ´ideal candidate´ Allardyce|
|Juventus begin ICC campaign amid Pogba furore|
|Sunderland look to move forward after Allardyce departure|
|Kuyt backs Wijnaldum for Liverpool success|
|No major trophies, fewer goals than Moyes - the stats behind England boss Allardyce´s career|
|Hayden was wasting his career at Arsenal - Wenger|
|New recruits excite Aubameyang after United rout|
|Allardyce the right man to take England back to basics|
|Solve the Rooney puzzle and restore Sterling´s confidence: Five problems for Allardyce to solve|
|England appoint Allardyce as manager|
|Manchester United 1 Borussia Dortmund 4: Classy BVB hand Mourinho first defeat|
|James vows to stay at Real Madrid|
|Caught in a jam - Minnesota ´explain´ goalkeeper gaffe|
|Clarke nominated for FA chairman|
|Gazidis expects more Leicester-style Premier League triumphs|
|Arsenal snap up Bolton defender|
|Alex the Mann for Liverpool as veteran seals Anfield move|
|Dortmund sign Schurrle on five-year deal|
|Balotelli needs right opportunity - Raiola|
|Lukaku undergoes Lazio medical|
|Suarez: Messi better than Ronaldo by far|
|Allegri remains hopeful of Pogba Juve stay|
|Rakitic´s agent questions Barcelona midfield buys|
|Shearer: England players must respect Allardyce or walk|
|Raiola: I don´t give a damn if Pogba costs a world-record fee|
|Mazinho dreams of Thiago-Rafinha reunion at Barca|
|No heart, no gold says ex-Brazil striker Elber|
|There is space for Mata at United - Mourinho|
|Alonso: Guardiola needs time to improve City|
|Argentina approach Bauza to be coach|
|Inter still ´under construction´ - Ranocchia|
|Mourinho: Rooney will be an important player|
|Ganso prepared for the step up to European football|
|Dyke: Brexit could help England|
|Galatasaray confirm Lucas interest|
|Conte targets Champions League with Chelsea|
|Swansea style attracted new owners Kaplan and Levien|
|Mourinho not concerned if United fail to sign Pogba|
|Mourinho teased Ibrahimovic into United move|