PORTO, Portugal (AP) — The Portugal fans at the Estádio do Dragão looked stunned when the referee returned from the video review booth and pointed to the penalty spot.

Where they about to witness another late collapse at home that could jeopardize the national team’s hopes of making it to the World Cup?

The 85th-minute penalty gave Turkey a chance for an equalizer after Portugal had opened a two-goal lead in their European qualifying playoff semifinal. But Burak Yılmaz's spot kick sailed over the crossbar, letting Portugal off the hook.

The hosts went on to score again in stoppage time for a 3-1 victory Thursday that moved Cristiano Ronaldo and Portugal a step closer to the World Cup.

“We can't let that happen. We had the game under control,” Portugal coach Fernando Santos said. “We lost some intensity but in the end the players responded well. Had that penalty gone in, it could have been difficult for us.”

It was a 90th-minute goal against Serbia in November in Lisbon that relegated Portugal to the qualifying playoffs to begin with, having blown a chance to finish as group winner.

Ronaldo's hopes of reaching a 10th straight major tournament will now come down to a winner-takes-all game against North Macedonia, which earned a stunning 1-0 win at Italy to end the European Champion’s hopes of making it to the World Cup. The game against North Macedonia will be on Tuesday in Portugal.

“Now we have to focus on North Macedonia,” Santos said. "If they managed to beat Italy, that means it’s going to be very difficult for us as well.”

Portugal is trying to qualify for the World Cup for the sixth straight time.

The 37-year-old Ronaldo has played in soccer’s showcase event four straight times. He also played in four consecutive European Championships, winning the title in 2016.

Ronaldo is the only player to have scored at least once in the finals of nine top tournaments in a row, a streak that started at Euro 2004 in Portugal.

Otávio opened the scoring in the 15th off the rebound of a shot by Bernardo Silva onto the post, and Diogo Jota added to the lead with a header in the 42nd after an assist by Otávio.

Yılmaz pulled Turkey closer with a goal from inside the area in the 65th, but the national team's second highest all-time scorer missed the chance to equalize when his shot from the penalty spot went over the crossbar. A video review had awarded the penalty for a foul by José Fonte on Enes Unal.

“I haven’t spoken to Yilmaz yet,” Turkey coach Stefan Kuntz said. “He needs to let himself go. (The penalty) was an important opportunity for the team, but sometimes you need luck, and that did not happen for us.”

Portugal sealed the victory with substitute Matheus Nunes scoring on a breakaway four minutes into stoppage time.

The Turkish side, which was second to the Netherlands in its qualifying group, was trying to make it to the World Cup for the third time after appearances in 1954 and 2002, when it finished third after losing to eventual champion Brazil in the semifinals.

Turkey’s last major achievement was making it to the semifinals of Euro 2008, when it lost to Portugal in the group stage.

Failure to qualify for Portugal could mean the end of the line with the national team for coach Santos and veteran players Pepe, Fonte and João Moutinho, who are all 35 or older.

Pepe was one of the key absences for Portugal after testing positive for the coronavirus this week. The team’s other regular-starting central defender, Rúben Dias, couldn’t play because of an injury. João Cancelo was suspended, and Anthony Lopes, Nelson Semedo, Renato Sanches and Rúben Neves also weren’t available because of injuries.

___

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP_Sports