Mattias Jonson struck a minute from time to earn Sweden a 2-2 draw with Denmark that sent both Scandinavian sides through to the Euro 2004 quarter-finals on Tuesday.
Jon Dahl Tomasson's second goal of the game had looked like giving Denmark victory but Jonson's close-range shot saved the Swedes and sent out Italy, whose 2-1 victory over Bulgaria was not enough as all three sides finished on five points.
Sweden topped the group and will play the Group D runners-up, Germany, the Netherlands or Latvia, in the last eight, while Denmark face the Czech Republic.
Tomasson beat Swedish keeper Andreas Isaksson with a dipping 20-metre shot into the top right-hand corner to put the Danes ahead after 28 minutes.
Sweden striker Henrik Larsson won and converted a penalty at the start of the second half to equalise with his third goal of the tournament but Tomasson matched the feat with a close-range finish after 66 minutes.
Italy had raised fears about the local rivals engineering a high-scoring to send both sides through but the way the tackles came flying in hardly pointed to a friendly fix.
With the ball skidding around on a pitch that had already been watered before kickoff, Denmark worried their opponents continually with sharp balls through the middle and the fizzing runs of wingers Jesper Gronkjaer and Martin Joergensen.
Gronkjaer popped up to take Tomasson's pass on 14 minutes and fire a shot into the side netting.
With Sweden sitting deep, Denmark continued to attack and Tomasson's spectacular strike gave them the opener just before the half-hour mark.
Sweden nearly equalised twice at the end of the first half, with defender Olof Mellberg and midfielder Jonson both sending in dangerous headers from corners, and they were level within two minutes of the re-start through Larsson's successful raid.
Sweden enjoyed a period of dominance but outstanding goalkeeping by Thomas Sorensen kept Denmark in the game, and Tomasson's sharpness clinched victory after 66 minutes.
Substitute Kasper Bogelund had a shot half blocked by the defence and the ball fell straight to Tomasson who slipped a low shot past Isaksson from eight metres.
Denmark (4-3-3): 1-Thomas Sorensen; 6-Thomas Helveg, 4-Martin Laursen, 3-Rene Henriksen, 5-Niclas Jensen (2-Kasper Bogelund 46); 7-Thomas Gravesen, 9-Jon Dahl Tomasson, 15-Daniel Jensen (17-Christian Poulsen 66); 8-Jesper Gronkjaer, 11-Ebbe Sand, 10-Martin Joergensen (19-Dennis Rommedahl 57)
Sweden (4-4-2): 1-Andreas Isaksson; 7-Mikael Nilsson, 3-Olof Mellberg, 15-Andreas Jakobsson, 5-Erik Edman; 17-Anders Andersson (20-Marcus Allback 81), 16-Kim Kallstrom (21-Christian Wilhelmsson 72), 18-Mattias Jonson, 9-Fredrik Ljungberg; 10-Zlatan Ibrahimovic, 11-Henrik Larsson
Referee: Markus Merk (Germany)
Linesmen: Christian Schraer (Germany), Jan-Hendrik Salver (Germany)