Emil Forsberg's deflected strike saw Sweden snatch a place in the World Cup quarter-finals with a narrow 1-0 win over Switzerland.
Forsberg struck after 66 minutes of a tight contest in St Petersburg when his shot from the edge of the area was diverted in by Manuel Akanji.
Switzerland pushed for an equaliser in the latter stages but neither Breel Embolo nor Haris Seferovic could find the net with late headers.
The Swiss finished the game with 10 men after Michael Lang was sent off for pulling down Martin Olsson as he raced through on goal.
Sweden were initially awarded a penalty for that offence but it was changed to a free-kick on the edge of the box after a review by VAR.
That proved the final act of the game as the Swedes held on to reach the last eight for the first time since 1994.
There had been little between the sides throughout the 90 minutes.
Xherdan Shaqiri looked to pull the strings for Switzerland and he imposed himself on the game early by delivering dangerous balls for Blerim Dzemaili and Josip Drmic, but neither could make the most of them.
The best opportunities of the first half fell to Sweden but they were let down by poor finishing. Marcus Berg found himself in a great position after being played in by an Ola Toivonen flick but he sliced wide.
Albin Ekdal also volleyed over twice. His first chance came after a poor clearance from Yann Sommer and the ball dropped his way after a Berg shot was blocked. He had another opportunity before the break when he was picked out at the far post by Mikael Lustig.
Berg did later hit the target with an effort that took an awkward bounce but Sommer produced a smart save to his right.
Granit Xhaka tried his luck from distance for Switzerland but failed to hit the target before Dzemaili put another attempt over after combining nicely with Steven Zuber. Zuber himself had a chance but headed over.
Shaqiri found himself in a good position early in the second half but could not get a shot away and Robin Olsen claimed the ball.
Both sides enjoyed spells of possession but struggled to apply pressure in the final third.
The breakthrough came when Toivanen picked out Forsberg on the edge of the area. Forsberg took a touch to improve his angle and connected with a low shot, but it only flew past Sommer - who might otherwise have saved - after taking a big deflection off Akanji.
That prompted Switzerland to show more urgency and Shaqiri had an effort deflected wide.
Embolo also threatened from a corner but Sweden captain Andreas Granqvist got back to block his header on the line before Robin Olsen kept out a Seferovic header.
Switzerland were caught out as they pushed up in injury time with Olsson racing clear and Lang hauling him down.
Sweden did not get the penalty they initially thought they had but it did not matter as time ran out for the Swiss.