MARSEILLE, France (AP)Tottenham advanced in the Champions League the hard way on Tuesday.

With manager Antonio Conte serving a suspension in the stands and one of its star players, Son Heung-min, forced off the field with a head injury, Tottenham was trailing 1-0 at halftime against Marseille and heading out of the competition.

So bad was the performance, Spurs didn’t have a touch in Marseille’s penalty area in the first half.

They managed to turn it around.

Pierre-Emile Hojbjerg scored with the last kick of the game at Stade Velodrome for a goal that sealed a 2-1 win and lifted Tottenham to the top of Group D above Eintracht Frankfurt, which had already clinched victory at Sporting – also 2-1 – and was sitting in first place until Hojbjerg’s goal.

That goal also meant Marseille finished in last place and will have no involvement in European competition in the new year.

”We could feel in the first half a team was playing without the fear to lose – it was Marseille,” Tottenham goalkeeper Hugo Lloris said. ”And in the second half, we had a team that was fearing to lose – and it was us.”

Marseille had to win to advance to the knockout stage for the first time since the 2011-12 season and dominated the first half, penning the visitors in their own half and finally taking the lead in stoppage time when Chancel Mbemba headed in unmarked at the far post after a quickly taken corner.

Tottenham’s players barely strung any passes together in the first half – defender Clement Lenglet later acknowledged he and his teammates were confused about how to approach the game – and received a blow when a dazed-looking Son was helped off the field after receiving a shoulder to his face by Mbemba. The forward, who is set to play at the World Cup for South Korea, appeared to be unsteady on his feet.

Starting the second half with a purpose – needing to score – helped Tottenham, which quickly gained a foothold and Lenglet headed home a 54th-minute equalizer by glancing in Ivan Perisic’s left-wing free kick. The pressure was back on Marseille.

In a nervy final 15 minutes, Hojbjerg struck the crossbar for Tottenham before, at the other end, Alexis Sanchez’s goalbound shot was deflected wide off the body of Perisic.

Marseille’s team contained four players who have played for Tottenham’s fierce rival, Arsenal, and one them – Sead Kolasinac – entered as a substitute and had a golden chance in the 87th minute to put the hosts ahead. Found by a cross to the far post, Kolasinac headed wide from barely two meters out.

Marseille’s players poured forward in search of a winner, much to the annoyance of its animated coach, Igor Tudor. He ended up straying onto the field of play in a bid to get across a message that a draw – which would have secured third place and spot in the Europa League’s qualifying playoffs – would actually have been fine.

”The players couldn’t hear it because it was so loud,” Tudor said. ”There was confusion at the end. Unfortunately, it cost us.”

Indeed, Tudor was on the playing surface as Tottenham broke forward in the fifth minute of stoppage time, with Harry Kane playing through Hojbjerg to crash a shot in off the post.

Conte watched the game in the stands as a result of his red card in last week’s draw against Sporting. He was mostly unmoved until the late goal, which brought out a wild celebration by Conte.

When Tottenham got to the Champions League final in 2019, the team only made it out of the group stage thanks to a late equalizer by Lucas Moura against Barcelona at the Camp Nou in the final round of games.

Spurs have been making slow starts to matches in this year’s group stage, too. Still, they are through, completing a clean sweep of English teams in the last 16.

”It was very difficult in the first half,” said Tottenham assistant coach Cristian Stellini, filling in for Conte on the touchline. ”And in the difficulties we didn’t lose our minds, we stayed in the match.”

AP World Cup coverage: https://apnews.com/hub/world-cup and https://twitter.com/AP-Sports