SOCHI, Russia — The puck trickled under Jesse Vetter’s pads and over the goal line, and then the whistle blew.

Or was it the other way around?

The Canadian women’s hockey team beat the United States 3-2 on Wednesday in a tense preview of the expected gold medal match, taking the lead on Hayley Wickenheiser’s controversial third-period goal. Meghan Agosta scored in the second period to tie the game 1-1, and then Canada added the go-ahead goal 93 seconds later on a shot that U.S. goalie Jesse Vetter seemed to have stopped, drawing a whistle from referee Anna Eskola of Finland.

But the puck slid through Vetter’s pads and over the goal line. A video — and presumably audio — review confirmed the puck went into the net before the whistle.

“You celebrate when you see the puck cross the line,” said Wickenheiser, who is participating in her fifth Winter Games. “It doesn’t matter how.”

But Vetter said she thought the whistle had blown before the puck came loose. American coach Katey Stone was even more sure of it.

“I did hear a whistle blow before the puck went in,” she said. “But, more importantly, I said to our players, ‘Regardless of what happens, let’s be ready.’”

They weren’t.

The Americans allowed Meghan Agosta to break into the zone by herself and beat Vetter with just over five minutes remaining — the second goal of the game for the MVP of the 2010 Olympics — giving Canada a 3-1 lead. The U.S. pulled the goalie and cut the deficit to one on Anne Schleper’s goal with 65 seconds left, but even with a power play that gave them a 6-on-4 advantage they couldn’t tie it.

It was the Canadians’ third consecutive Olympic victory over the U.S., including the gold medal games in Vancouver and Salt Lake. But it was their first victory over the Americans for coach Kevin Dineen, who took over the team in December after a career in which he played for Hartford and Columbus and saw rivalries like the Red Sox and Yankees and Michigan-Ohio State up close.

“I think this one is the real deal,” he said. “You always say, ‘Oh, they don’t like each other.’ I don’t think that. I think there’s a mutual respect there. Sometimes to be really good, you have to have a foil.”

Finland’s Jenni Hiirikoski scored her second goal of the game with 2:22 left in overtime to help the 2010 bronze medalists escape with a 4-3 victory over Switzerland earlier Wednesday. The Finns earned the No. 3 seed in the Olympic playoffs, and they will play the loser of the round-robin finale between Russia and Sweden, with the other facing Switzerland.

“It’s getting to be the fun part now,” said Michelle Karvinen, who also scored twice for Finland. “I’ve been looking forward to getting to the real part of the tournament.”

Hilary Knight also scored and Vetter stopped 28 shots for the United States, which also had secured a spot in the semis already. Charline Labonte made 25 saves for Canada, which had already earned a bye into the semifinals and now will take the No. 1 seed into the playoffs.

If they both win, they would meet again in the final.

“There’s always plenty on the line” against the Americans, Wickenheiser said. “Whether there’s a gold medal or not, it feels like a gold-medal game.”

It’s the fifth time the teams have met in the Olympics, but the first since women’s hockey was added to the Winter Games in 1998 that they have played in the preliminary round. The Americans beat Canada twice that year — including the gold medal game — but it’s been Canada ever since, at least in the Olympics.

In addition to leading their southern neighbors 3-1 in Olympic gold medals, Canada has 10 world championships to five for the United States. (No other country has won even one.)

The Americans have won five of the last seven, though, including last year’s in Ottawa. In a pre-Olympic tuneup tour, the Canadians won three straight but then lost four in a row in the turmoil following coach Dan Church’s surprise December resignation; he was replaced Dineen.

Through all of the winning and losing streaks, the teams have remained equal. And that’s the way they played it for the first 37 minutes, with the goalies withstanding rush after rush to keep their shutouts intact.

The fans shouted dueling chants of “Ca-na-da!” and “U-S-A!” And none of the players on the bench sat down, either standing to cheer on their teammates or leaning over the boards.

The United States finally scored when Schleper’s wrist shot was tipped by Knight into the net. But Canada tied it with a power-play goal of its own, making it 1-1 in the third period when Agosta parked on the right side of the net and waited for the pass from Wickenheiser.

The Canadians celebrated a second goal just 93 seconds later, then Agosta scored on a breakaway to make it 3-1.