For Roy Hodgson, the England manager for whom the knives appeared to be out before he had selected his squad, this was a particular triumph.

His selection of Andy Carroll was rewarded with a fine opening goal from the Liverpool striker; his decision to introduce Theo Walcott resulted in the two goals that turned the match around after England had blown that lead; then, the night ended with his team requiring just a point against Ukraine to ensure they progress to the knockout stages.

In a breathless second half, big on drama if not quality, Olof Mellberg scored twice amid chaos in the England penalty box to give Sweden the lead. Then Walcott scored soon after replacing James Milner, before his darting run created the winner for Danny Welbeck, the Manchester United man twisting in to a deft finish to flick the ball beyond Andreas Isaksson.

Welbeck said the impact made by Walcott was not as big a surprise as the defensive disorganisation that allowed Mellberg to strike twice after the break. "I'm delighted to get the winning goal but it was more of a team performance," said the forward. "At the start of the second half we let in two sloppy goals and that's something we want to put behind us. Our defending at set pieces was a bit sloppy, but towards the back end of the game we showed we could deal with quality balls into the box.

"Our team spirit showed and we're delighted to get three points. We're all very pleased for Theo. We know when he gets on the pitch he's going to make a difference. That's what he's done today."

The first half gave no indication of the drama to come until Carroll scored. Once again, the goal was created by the captain, Steven Gerrard, a key player for Hodgson in the two games to date. From virtually the identical position from which he created Joleon Lescott's goal in Donetsk on Monday, the Liverpool launched an inviting cross to the far post. Carroll got between defenders and powered his header into the bottom corner.

Ashley Cole threaded an excellent ball through Sweden's defence for Ashley Young to run on to soon after, but a poor first touch cost the Manchester United man valuable momentum and he ended up snatching at his shot, which Isaksson saved by the near post.

Four minutes after the restart, Sweden were level and the first error was Carroll's. The striker fouled Kim Kallstrom 30 yards from the England goal and after that, their defence crumbled. In lifting the ball back into the box after his initial free-kick had been blocked, Zlatan Ibrahimovic could not have expected to pick out Mellberg, completely unmarked, eight yards out. Joe Hart made a fine one-handed save from the defender, only for the ball to bounce in to Glen Johnson, who failed in a desperate attempt to keep the ball out.

Worse was to come for Hodgson's team. Having scored from a deep cross, England showed a shuddering ineptitude at defending them as Seb Larsson drove a touchline free-kick deep into the box. Mellberg was completely on his own and gave Hart no chance from point-blank range.

Hodgson took immediate action, replacing Milner with Walcott and was soon repaid by the Arsenal winger. Three minutes after coming off the bench, Walcott, hanging back at a Gerrard corner, collected the loose ball from a Sweden clearance and, with defenders rushing out to shut down the shooting opportunity, fired high past Isaksson. The goalkeeper, unsighted, was totally deceived and could only watch as the shot flew past him, only a few inches out of his reach.

It was Walcott's first goal since a hat trick in Croatia almost four years ago – and probably his best international performance.

Even though, after a draw, both sides could have advanced with a last-game win, the game became stretched, as if they realised how generous the defences had become.

Hart shovelled Ibrahimovic's shot wide before England countered and got their winner. Walcott drove between two defenders and away from goal, toward the bye-line. He pulled a cross back to the near post, slightly behind Welbeck, who spun in to a back heel that found the bottom-left corner.

Gerrard was foiled by Isaksson in stoppage time after an attack he led was taken on by another piercing Walcott run. When the winger crossed, Gerrard's left-foot volley was superbly blocked.

The result leaves Hodgson wondering how to restore Wayne Rooney to his starting line-up, though it is inconceivable that the forward, suspended for the first two games, will not play against Ukraine.