The Newcastle United number one started in goal at the Gazprom Arena in St. Petersburg and made a world class stop to deny Ludwig Augustinsson just before the hour mark.
Augustinsson's powerful header looked destined for the back of the net, but Dúbravka somehow shifted his weight to keep it out with a strong left hand. He then made another good save from Alexander Isak in the 71st minute - but gave away a penalty shortly afterwards, and was booked for bringing down Robin Quaison as the Mainz 05 forward raced through on goal.
Emil Forsberg coolly converted from the spot, despite Dúbravka going the right way, meaning Sweden - who drew 0-0 with Spain in their opening game of the tournament on Monday - top Group E and are well placed to qualify for the last 16. Slovakia can still progress too, having beaten Poland in their first match, but will probably need at least a point against Spain on Wednesday.
Krafth replaced Forsberg as a 93rd minute substitute for Sweden, whose final group game - also on Wednesday - is against Poland. The Magpies defender made a vital block within seconds of his introduction to ensure his side collected all three points.
Meanwhile, Scotland kept their own hopes of qualifying for the knockout stages alive with a 0-0 draw against England at Wembley in Group D. Ryan Fraser was an unused substitute for the Tartan Army, who welcome Croatia to Hampden Park on Tuesday night.