(CNN) -- England produced a stunning comeback at the Cricket World Cup on Sunday to beat South Africa by six runs in a dramatic encounter in Chennai, India.
After being bowled out for just 171, England looked set for another disappointing result, following-on from their disastrous defeat to competition minnows Ireland and thrilling tie with India.
Aside from a 99-run fourth-wicket stand from Jonathan Trott and Ravi Bopara, the England batsmen could not offer any resistance to spin bowler Robin Peterson -- who dismissed openers Andrew Strauss and South Africa-born Kevin Pietersen in the first over.
In reply, South Africa still looked the likely victors at 124-3, but quickly lost four wickets for three runs in five overs and slipped to 127-7.
An eighth wicket stand of 33 between Morne van Wyk and Dale Steyn raised one last hope of a South African victory, before bowler Stuart Broad claimed two wickets in four balls to complete the England fightback with 14 balls to spare as the Proteas fell for 165.
England captain Andrew Strauss said that the win had come just at the right time for his side, who now move to second place of the table ahead of their last two remaining Group B games against Bangladesh and the West Indies.
"The guys showed a lot of fight. This puts us back on track in the World Cup and it couldn't come a day too soon," Strauss, who also led England to Ashes glory in Australia at the start of the year, told reporters.
"We're delighted and we have high hopes of achieving a great thing. We still need to learn some lessons but we got away with a win and a win is all you need to kick-start things and get it going," he added.
South Africa dropped into third place with the loss, but they have played one less game than England and still remain on course to claim one of the four quarterfinal spots.
But the result has created doubts as to whether South Africa have the ability to close out a match from a winning position.
"We've handled ourselves in some tough situations over the last few years, I don't think pressure is our weakness," South Africa captain Graeme Smith said.
"It's obviously disappointing -- we've got to learn from today, and pick ourselves up to play India."
Meanwhile in Sunday's other Group B contest, India beat Ireland by five wickets in Bangalore to go to the top of the table.
Ireland could not repeat the form that saw them beat England, and will now find it tough to qualify for the last eight from fifth position.
Their next tie is against the West Indies, while India face bottom-of-the-table the Netherlands.