Goals from Deco and Cristiano Ronaldo secured Portugal's passage into the last 16 of the World Cup after victory over Iran in Frankfurt.
Deco's persistence eventually paid off in the 62nd minute
Barcelona playmaker Deco opened the scoring on 62 minutes with a vicious 22-yard strike past stranded Iran goalkeeper Ebrahim Mirzapour.
And Ronaldo doubled the score from the penalty spot when Luis Figo was brought down in the box on 78 minutes.
Javad Nekounam went closest for Iran, who now cannot qualify.
But despite their dominance Portugal failed to capitalise on their superiority, a factor which is likely to concern manager Luiz Felipe Scolari.
The best chance of the first half fell to Deco, who was denied when his fierce left-foot drive from eight yards was brilliantly saved by Ebrahim Mirzapour after 12 minutes.
The goalkeeper somehow managed to force the ball over the crossbar for a corner, much to the despair of the Brazilian-born star.
Wingers Luis Figo and Ronaldo began to exert their influence in midfield as both men created problems with their slick dribbling skills.
Ronaldo was a constant thorn in the Iranian defence's side
But neither man could find the incisive ball for striker Pauleta, who toiled alone up front with little success.
Ronaldo's pace saw him carve open the Iranian defence on 33 minutes, but his wicked 16-yard strike agonisingly shaved the wrong side of Mirzapour's left-hand post.
Despite continuous Portuguese pressure, the Iranians managed to cause the odd problem in their opposition's penalty area - Mehdi Mahdavikia's inswinging free-kick had goalkeeper Ricardo tentatively punching clear.
But Portugal's attacking instincts were eventually rewarded on 62 minutes when Deco collected Figo's pass five yards outside the Iranian penalty area.
The Barcelona player needed just one touch, striking a sweet first-time shot past the helpless Mirzapour, who could only watch the ball sail into the top left corner.
The goal forced Iranian coach Branko Ivankovic to make changes - and his substitution almost paid off when Rasoul Khatibi, on for striker Mehrzad Madanchi, fired just wide after Fernando Meira misjudged a long ball.
Victory was eventually secured in the 78th minute when Iran captain Yahya Golmohammadi needlessly brought down Figo in the penalty area.
Ronaldo stepped up and confidently converted from the penalty spot, firing into the top left-hand corner.
Iran should have pulled a goal back in the 92nd minute, but Javad Nekounam headed wide after rising unchallenged from a free-kick.
Ronaldo thought he had scored his second of the game in the dying seconds, but his six-yard shot was adjudged offside.
Portugal: Ricardo, Miguel, Meira, Ricardo Carvalho, Nuno Valente, Costinha, Maniche (Petit 66), Deco (Tiago 80), Ronaldo, Pauleta, Figo (Simao 88)
Subs Not Used: Paulo Ferreira, Caneira, Ricardo Costa, Boa Morte, Nuno Gomes, Paulo Santos, Postiga, Quim, Viana
Booked: Pauleta, Deco, Costinha
Goals: Deco 63, Ronaldo 80 pen
Iran: Mirzapour, Kaebi, Rezaei, Golmohammadi, Nosrati, Mahdavikia, Nekonam, AKarimi, Taymoorian, Madanchi, Hashemian
Subs Not Used: Borhani, Daei, Enayati, Kazemeian, Navidkia, Roudbarian, Sadeqi, Shojaei, Talebloo
Booked: Nekounam, Madanchi, Kaabi, Golmohammadi
Referee: Eric Poulat (France)
Fifa man of the match: Deco
Portugal have successfully navigated a World Cup group for the first time since 1966 when they finished in third place. Iran have now failed to survive the group stage in all three of their World Cup participations.
Deco and Ronaldo became the 10th and 11th different goalscorers for Portugal at the World Cup. At the age of 21 years and 132 days, Ronaldo became the youngest ever goalscorer for Portugal at a World Cup finals. The previous record was set by Simoes in 1966 who was 22 years and 217 days old when he scored.
Portugal were awarded their first penalty at the World Cup since 1966, when Eusebio scored against the USSR.