Striker Jermain Defoe rescued England's stuttering World Cup campaign with a first-half strike that was enough to beat Slovenia 1-0 in Group C on Wednesday and book a place in the second round.
Slovenia looked as if they would also be going into the knockout stages until the United States grabbed a goal in added time to beat Algeria 1-0 and book their place in the last 16. The results mean Slovenia and Algeria have been eliminated.
Defoe started for the first time in the tournament and converted James Milner's perfect cross in the 23rd minute to put England ahead and send their suffering fans into a frenzy.
England will play the Group D winners - Ghana, Germany, Serbia or Australia - on Sunday in Bloemfontein after coming second behind the United States, who beat Algeria 1-0.
England finished level on five points with the U.S. but were runners-up on goals scored. Slovenia ended their campaign on four points with Algeria on just one point.
England were always in control and looked like a completely different team to the side that struggled to successive draws in their opening two games, with Wayne Rooney in battling mood and Defoe proving a menace for the Slovenia defence.
"We play together, we fight together", said England coach Fabio Capello. "I've again found the team I know. We can go forward against all the teams because the players' minds now are free, without fear, without doubt".
Goalscorer Defoe added "At this level it's always going to be difficult. If you look at the other games a lot of the top teams have struggled so it's important to keep the spirit, which we have done, and it showed tonight".
NERVOUS STARTDefoe had started in place of Emile Heskey in attack with Milner in the lineup for the ineffective Aaron Lennon.
Matthew Upson started in central defence with Jamie Carragher suspended.
England started nervously but soon found their feet, with Rooney working hard and linking up with Defoe, Milner and Gerrard in a series of attacks on the Slovenian goal.
Rooney, Frank Lampard and John Terry all came close but England's pressure finally paid off when Milner broke free on the right and superbly picked out Defoe for a clinical finish.
Defoe almost scored again three minutes later when his shot from outside the area was palmed away by goalkeeper Samir Handanovic, with Lampard blasting the rebound over the bar.
England could have doubled their lead on the half-hour when Handanovic pulled off a superb double save from Defoe and then Gerrard before leaping on the loose ball as it spun precariously towards the goal line.
England kept up the pressure after the break, with Defoe having an effort disallowed for offside and Terry almost getting on the score sheet when his close range header was saved.
Rooney, heavily criticised in the first two matches, continued to trouble the Slovenian defence in the second half, riding out the tackles and hitting the post on the turn when Handanovic got the slightest of touches to his effort.
That effort just before the hour mark was Rooney's last significant contribution and the toiling England striker was replaced by midfielder Joe Cole after 72 minutes.
"I think Wayne will be okay for the next game", Capello said, adding the striker was suffering with an ankle problem.
Slovenia had few clear chances but England were worried after 67 minutes when Bostjan Cesar picked up a loose ball and shot narrowly wide. They kept up the pressure until the end but could not find a way through a resilient England defence.