SARANSK, Russia (AP) -- Cristiano Ronaldo's missed penalty cost Portugal first place in its World Cup group.
It could have been worse if not for Ricardo Quaresma, who started for the first time in the tournament and scored his maiden World Cup goal with a shot that had about as much flare as any in the tournament.
Portugal finished second in Group B after a 1-1 draw with Iran on Monday. The 2016 European champions will next face Uruguay on Saturday in the round of 16.
"The conclusion and the most important thing is we're going to continue playing," Portugal coach Fernando Santos said. "We had a strong opponent."
Quaresma became the only player other than Ronaldo to score for the Portuguese in three games in Russia. The 34-year-old midfielder also became Portugal's oldest scorer in World Cup play by hitting a curling shot from the edge of the penalty area that went beyond the reach of diving Iran goalkeeper Ali Beiranvand.
Ronaldo -- who had scored all four Portugal goals in its first two games of Group B play -- was denied on his penalty by Beiranvand's dive toward the right post in the second half.
"We were on top of the game until the penalty, and we didn't make it. It wasn't perfect, but that's football," Santos said. "We did what was expected and now we have to settle down and think about Uruguay."
Karim Ansarifard scored a late penalty for Iran, which need to win to advance, but couldn't break through a second time despite a furious charge in the waning minutes. The Mordovia arena momentarily vibrated from the sound of Iran fans' roars when Mehdi Taremi hit the side of the net from 6 yards out.
The penalty against Portugal was awarded after a video review showed a handball in the area. But although Iran coach Carolos Queiroz benefited from that review, he railed against the system for the second day in a row. In particular, he cited a decision to give Ronaldo a yellow card after his elbow struck Iran defender Morteza Pouraliganji in the face in the second half.
"Elbow is a red card in the rules," Queiroz asserted in English, adding that there are no written exceptions for players named Ronaldo or Lionel Messi. "The decisions, they must be clear for everybody, for the people. Everybody agrees that VAR is not going well. That's the reality. There are a lot of complaints."
Spain won Group B after its 2-2 draw with Morocco. Both Spain and Portugal had a goal difference of plus-1, but Spain scored six goals in its three group matches while Portugal had five.
Spain will next face host Russia on Sunday in Moscow.
Quaresma had nine international goals in 78 previous appearances for Portugal. But his goal against Iran had all appeal of a Ronaldo strike. He sent the shot with the outside of his right foot spinning into the far corner near the end of the first half.
Not bad for someone who had played little more than 20 minutes as a substitute in Portugal's first two games. Ronaldo certainly looked impressed, wrapping his right arm around Quaresma's shoulders as he roared and raised his left fist into the air.
Quaresma declined an opportunity to boast when asked if he thought his goal was among the tournament's best, saying what matters most is the squad's success.
"I was a bit lucky with the goal," Quaresma said. "Most importantly, we fulfilled our objective and we're looking forward to the next round."
Santos's confidence that Quaresma was ready to influence the game not only was evident in his decision to start the veteran, but in the coach's comment afterward.
"I always take the decisions that are right for my team," he said.
Ronaldo smiled confidently as he walked past reporters after the game, but avoided answering questions. He has now missed six of his last 14 penalty kicks, but he hasn't been the only big star to miss one in this tournament. Messi also was denied in Argentina's opening draw against Iceland.
Ronaldo's penalty was awarded after the use of video review following an apparent takedown of the Portugal forward by Saeid Ezatolahi in the area. The Iranian team, already aggrieved by the replay system overturning a goal against Spain, reacted angrily. Players swarmed Paraguayan referee Enrique Caceres, who initially had waved play on after Ronaldo went down.
Iran has been to five World Cups -- all since 1978 -- but has yet to advance out of group play.
Its players collapsed on the field at the final whistle, while Portugal's somewhat muted celebration had the look of relief.
After the match, Queiroz was asked if he was aware how proud Iran was of its team's performance, which included a 1-0 victory over Morocco and a 1-0 loss to Spain.
"I'm very proud," Queiroz said. "We earned respect from people who had no idea that Iran could fight so well."