Team Canada nearly stumbled its way into the world junior hockey championship.

The Canadians saw a 3-0 first-period lead melt away against Switzerland on Friday night, Nicolas Roy staving off a potentially worrisome defeat on the eve of the tournament with the overtime winner. It was a real jolt to the Canadians, who won their first two pre-tournament games by a combined 10-0 margin.

"Every team has to go through some of that [adversity] at some point," said captain Dylan Strome, who scored once and added an assist in the 4-3 win. "I think it's good for us to have a game where it was pretty close and we had to battle."

Nico Hirschier scored a pair for the Swiss in the second period after Canada raced out to a 3-0 lead in the first seven minutes of regulation. Dominik Diem tied it at three moments into the third before Roy banged home the winner in overtime, the six-foot-four Carolina Hurricanes prospect pouncing on a Philippe Myers's shot that sailed wide of the goal.

Carter Hart yielded three goals on just 14 shots. Head coach Dominique Ducharme wouldn't confirm him as the starter for Monday's preliminary-round opener against Russia.

Strome got it started quickly for the Canadians, beating Joren van Pottelberghe with a shot from the right face-off circle on a power play one minute 35 seconds into the opening period. Dillon Dube made it 2-0 just over two minutes later, Dante Fabbro adding another a few minutes after that, his innocent-looking shot from the left point beating the Swiss goalie short-side for the 3-0 lead.

Canada outshot Switzerland 6-1 after the first 12 minutes and 10-3 for the period. Snow piled up in the Swiss zone, the ice remaining pristine on the Canadian side.

Hart wasn't tested much at all, but did require one quality save in the early going. The Philadelphia Flyers second round draft pick denied Yannick Zehnder on a short-handed breakaway at one point, the Swiss forward getting his chance when Julian Gauthier's stick shattered in the neutral zone on a Canadian power play.

Swiss comeback

Switzerland came out strong in the second, finally sustaining some time in the Canada end. They broke through on an odd-man opportunity, Hischier taking a pass in the slot with speed and beating Hart.

The 17-year-old Hischier, a potential top-10 overall pick in the 2017 NHL draft, has been called the "Swiss McDavid". A rookie for the Halifax Mooseheads, he ranks among the QMJHL's leading scorers this season with 48 points in 31 games.

He added his second of the game about five minutes after the first, again off the rush. Defenceman Noah Juulsen was unable to close the gap on Hischier before he fired a shot past Hart.

Canada still outshot the Swiss 7-4 in the period, but it was clear who the better team was.

"Second periods have kind of let us down and it happened again tonight so we'll try to fix that," Strome said. "I think we just kind of took our foot off the pedal. They had some chances where we were back-checking, but we weren't going full way to the back of the house and they kind of took advantage of it."

Switzerland scored their third goal to tie it in the opening minutes of the final period. Diem, who notched assists on both of Hischier's goals, managed to gain a step on Strome as he strode through the slot, his shot just squeaking through the pads of Hart before crossing the goal-line.

It was the third goal on eight shots to beat Hart, still likely to be Canada's starter when the tournament begins on Boxing Day.

Canada picked up its pace thereafter, Pierre-Luc Dubois nearly scoring on a strong drive to the net during a power play, Blake Speers grabbing another chance from the slot shortly after.

The Swiss didn't land another shot after their goal for more than 10 minutes, the Canadians noticeably more engaged and in gear, though unable to take advantage of a pair of third period power plays.

Canada went 1 for 4 with the man advantage.

"I liked the way we reacted after the midpoint of the third period, the way we played of the rest of the game," Ducharme said. "We're going to be ready to for the 26th."

Canada has been held without a medal in three of the past four world junior tournaments, including a stinging sixth-place showing last year.

"It's a free lesson," Ducharme said of Friday's close call. "It's good to be confident, but you have to remember what makes you successful and we got away from that a little bit and we saw the effect of getting away from that. It's just part of preparing and sometimes you need to face that."