Nani scored twice as Portugal beat Iceland 5-3 Friday, setting up a decider with Denmark next week for automatic qualification to next year's European Championship finals.

Portugal and Denmark are tied on 16 points at the top of Group H, but as Portugal won the home game between the teams, a draw for the Portuguese in Copenhagen on Tuesday will be enough to send them to the tournament as group winners.

Nevertheless, Portugal went off the boil in the second half and failed to convince against the unheralded Icelanders who have taken just four points from eight matches.

Nani put Portugal ahead in the 13th with a header, deflecting an Eliseu cross from the left and sending the ball into the far corner.

The Iceland defense gifted Nani his second goal eight minutes later as captain Eggert Jonsson mishit his backpass and the Manchester United winger ran in to tap home.

Helder Postiga made it 3-0 just before halftime with a short-range shot that went in off the underside of the bar.

Portugal is one of FIFA's top 10-ranked teams in the world but it ran out of ideas in the second half and let its opponent back into the game, raising questions about whether it can get past the Danes next week.

Hallgrimur Jonasson got Iceland's first away goal with a 48th-minute header and then made it 3-2 in the 68th.

Joao Moutinho and Eliseu, earning his third cap, scored in the last 10 minutes before a late Gylfi Sigurdsson penalty.

The Portuguese hadn't conceded a goal in their previous two games.

''It's never nice to condede three goals at home,'' Portugal coach Paulo Bento said. ''We weren't as consistent in defense as we have been.''

Portugal has racked up five straight wins under Bento who took over after the Portuguese collected just one point from their first two qualifiers.

Portugal, a finalist at Euro 2004 on home turf, has never won an international trophy.

Cristiano Ronaldo, who had twice tested goalkeeper Stefan Magnusson in the early stages, struck a fierce shot against the woodwork in the 47th.

----

Lineups:

Portugal: Rui Patricio; Joao Pereira, Bruno Alves, Rolando, Eliseu; Carlos Martins (Ruben Micael 72nd), Raul Meireles (Miguel Veloso 59th), Joao Moutinho; Nani, Helder Postiga (Nuno Gomes 88th), Cristiano Ronaldo.

Iceland: Stefan Magnusson; Eggert Jonsson, Birkir Saevarsson, Kristjan Sigurdsson, Hjortur Valgardsson; Theodor Bjarnason, Johann Gudmundsson, Rurik Gislason; Gylfi Sigurdsson, Hallgrimur Jonasson, Veigar Gunnarsson.