Cristiano Ronaldo broke Sweden's resistance late in the game to give Portugal the advantage in their World Cup play-off tie in Lisbon.
The Real Madrid forward got the decisive goal when he stooped low to head in Miguel Veloso's superb cross.
Up until then they were frustrated by a disciplined Sweden side, who went close through Johan Elmander, Sebastian Larsson and Kim Kallstrom.
Ronaldo heading for World Cup?
No player has scored more headed goals (four) than Ronaldo in European World Cup 2014 qualification
The second leg will take place at Solna's Friends Arena on Tuesday.
That promises to be another fascinating contest between two sides, with the impetus now on Sweden to attack, having set their stall out to defend for long periods during the first leg.
They did, however, create the better chances in the opening 45 minutes despite Portugal enjoying 67% of the possession.
With Paris St-Germain forward Zlatan Ibrahimovic given special attention by Portugal's defence, his attack-minded team-mates found themselves with more space than they should have been afforded.
Norwich's on-loan forward Elmander was first to cause nerves in the home support when he stretched to send Mikael Lustig's right-wing cross inches past the post.
Erik Hamren's men then created two great chances in the space of two minutes. Sunderland's Larsson surged forward from midfield to strike a low shot that Rui Patricio dived to his left to divert, before Kallstrom, winning his 107th cap, smashed an 18-yard free-kick that brushed Portugal's upright.
Ibrahimovic failed to register a single touch in the opposite box against Portugal
The home side's best chance of the half came in the first five minutes when Ronaldo and Raul Meireles combined before feeding Joao Moutinho, who drifted round keeper Andreas Isaksson before firing into the side-netting.
Portugal's frustrations continued after the break as Sweden sat deeper, while their coach Paulo Bento probably would have been left exasperated by some of the awful attempted deliveries into the area.
But with eight minutes left one cross led to something greater when Dynamo Kiev's Veloso's fantastic delivery found Ronaldo, who threw himself at the ball to give Portugal the lead.
Moments later, the Real Madrid marksman almost scored his 30th of the season, but saw his header bounce back off the crossbar.
Zlatan Ibrahimovic will have to be more influential in the second leg for Sweden to reach Brazil
Sweden offered little as an attacking threat after the break, with Ibrahimovic failing to trouble Patricio and his defence. The skipper will have to show the sort of form he has produced for Paris St-Germain this season on Tuesday if Sweden are to stand a chance of going to Brazil.
"We would have been very happy with a draw," Sweden coach Erik Hamren said.
"We played a good game defensively - the goal was unnecessary, we were careless with that cross."
Bento added: "We created a great early chance and Sweden hit back. But in the second half it was one way for us.
"It was an important step to reach the World Cup but not yet decisive."
- 12 Patricio
- 21 da Silva Pereira Booked
- 05 Fábio Coentrão
- 04 Veloso
- 03 Pepe
- 02 Regufe Alves
- 16 Meireles (Josué - 78' )
- 08 Moutinho
- 23 Postiga (Pereira de Almeida - 66' )
- 17 Nani
- 07 Ronaldo Booked
- 01 Dos Reis Carvalho
- 06 Carvalho
- 09 Pereira de Almeida
- 10 Macedo Lopes
- 11 Na Bangna
- 13 Moreira da Costa
- 14 Neto
- 15 Almeida
- 18 Varela
- 19 Antunes
- 20 Josué
- 22 Bastos Pimparel
- 01 Isaksson
- 02 Lustig
- 05 Olsson
- 06 Elm (Wernbloom - 72' )
- 04 Nilsson
- 13 Antonsson
- 07 Larsson Booked
- 09 Källström (Svensson - 77' )
- 10 Ibrahimovic
- 11 Elmander Booked (Gerndt - 88' )
- 19 Kacaniklic
- 03 Olsson
- 08 Svensson
- 12 Wiland
- 14 Gerndt
- 15 Granqvist
- 16 Wernbloom
- 17 Bengtsson
- 18 Johansson
- 20 Toivonen
- 21 Durmaz
- 22 Zengin
- 23 Nordfeldt