By Martin Gallagher

Cristiano Ronaldo spent the biggest moment of his international career in the Portuguese dugout with a sore left knee. Injured nearly two hours earlier, there was nothing he could do in the Euro 2016 final except pace around like a manager wearing shorts.

But in those nervous closing stages of last night’s game, perhaps for the first time in a decade, Portugal didn’t need Ronaldo, its brightest star. With a goal from nowhere in extra time, it defeated host nation France 1-0 to win its first major championship.

“We lost our main man, the man who could score a goal at any moment,” Portugal defender Pepe said of Ronaldo, who left the game in the 25th minute. “But we were warriors on the pitch. We said that we’d win it for him.”

Renato Sanches (top) and Portugal’s players celebrate Eder’s winning goal during extra time of the Euro 2016 final against France. The win gave Portugal its first major-tournament trophy.

For France, the defeat bordered on unthinkable. Les Bleus had convinced themselves that history was within their grasp at the Stade de France. On the same field where they won the 1998 World Cup, on the home soil where they hadn’t lost any of their previous 18 major-tournament matches, they felt the trophy was theirs for the taking.

But, in a fitting end to a tournament lifted by underdogs, Portugal spoiled the party. It was the country’s first win over France at a major tournament.

Les Bleus’ sudden return to reality came when Eder cold-cocked the French defense in the 109th minute, swooping through the middle to fire a low shot past goalkeeper Hugo Lloris. The Stade de France fell silent, save for the red-and-green corner of Portugal fans. The disappointment of Ronaldo’s early exit felt like it had come weeks before.

When it was over, Ronaldo hobbled back onto the field, knee heavily bandaged, to close a season that saw him lift two of the most prestigious trophies in soccer.

He now has a first international title to add to the Champions League he won with Real Madrid in May. But his contribution to both finals remains tinged with weirdness. In the Champions League, he was largely invisible until taking the clinching penalty in a shootout. He wasn’t on the field yesterday for 95 minutes of play.

“He still gave us all his strength and bravery, and we got this important victory, both for him and all of Portugal,” Eder said.

Like France, Portugal knows the heartbreak of losing the Euros on home turf all too well. Twelve years ago, when Ronaldo was 19 years old and already a starter for the national team, his side was stunned by Greece in the final in Lisbon.

“I’ve been looking for this for a long time,” Ronaldo said. “Since 2004, I’ve asked God for a second chance at this.”

On that night, Portugal manager Fernando Santos was working as a radio analyst at the game. And for most of Sunday evening, he seemed to have a front-row seat to another sob story.

In the eighth minute, France midfielder Dimitri Payet crashed into Ronaldo, catching him around the left knee, with a tackle that didn’t draw a whistle from the referee. Ronaldo tried desperately to carry on. He called for on-field treatment twice. But 15 minutes after the initial challenge, he couldn’t keep up the fight.

On the stretcher to the tunnel, amid a standing ovation from both halves of the crowd, Ronaldo burst into tears. Then the atmosphere died.

France dominated regulation but spent most of the evening running into Portuguese goalkeeper Rui Patricio and, on one occasion, the Portuguese woodwork. They had 17 attempts at goal to Portugal’s six, but Les Bleus couldn’t make the difference. The last, most galling miss before extra-time fell to France’s Andre-Pierre Gignac, who hit the post in stoppage time.

“It was quite a closed match, but we had our chances,” France manager Didier Deschamps said. “The disappointment is there. It’s huge. And it will take time to digest it.”

Before Sunday, the final was being painted as a moment of catharsis for the host nation, which had known nothing but soccer heartbreak and calamity since winning Euro 2000.

At the 2002 World Cup, it crashed out in the group stage without scoring a goal. At Euro 2004, France was one of Greece’s unlikely victims during Greece’s run to the title. It lost the 2006 World Cup after a headbutt by star Zinedine Zidane and the team went on strike in 2010 in South Africa. Ever since then, Les Bleus have been trying to win back the French public.

Portugal snuck up on this tournament after drawing all three games in the group stage and finishing third. It didn’t beat any of its opponents in regulation until the semifinal win over Wales. But over the course of those games, Santos’s men grew into a mean defensive unit. He freely admitted that it wasn’t pretty, but it got the job done.