Goalkeeper Alyssa Naeher stopped three penalties and scored one herself to help the U.S. win a shootout after Canada rallied twice to tie it 2-2 after extra time in the CONCACAF W Gold Cup semifinals on a dramatic, soggy night in San Diego.

Lindsey Horan, Sophia Smith and Naeher scored from the spot for the second-ranked Americans. Quinn, who goes by one name, was the lone Canadian to score from the spot with Naeher denying Adriana Leon, Jordyn Huitema and Jessie Fleming.

American Korbin Albert sent her kick over the crossbar.

Canada came back twice with goals in the 82nd minute from Huitema and the 127th minute from Leon, also from the penalty spot.

Smith gave the U.S. a 2-1 lead with a 99th-minute goal. American Emily Sonnett pumped the ball forward and Rose Lavelle outjumped Canadian defenders Jade Rose and Vanessa Gilles to head it towards an unmarked Smith in the penalty box to hammer home.

Canada pressed in the dying moments and there was more late drama when Naeher took out Gilles as they both contested a high ball in the box, sending Mexican referee Katia Garcia to the pitchside monitor.

Garcia pointed to the penalty spot and Leon beat Naeher to tie it up for her sixth goal of the tournament

It had seemed like Canada’s tournament would end in a 1-0 loss on a rain-drenched pitch at Snapdragon Stadium, thanks to teenager Jaedyn Shaw’s 20th-minute goal.

But Huitema rescued Canada, heading home an Ashley Lawrence cross after some dogged work by Leon on the edge of the U.S. penalty box. It was Huitema’s 21st goal in 78 appearance for Canada.

The Canadians kept coming and the U.S. was hanging on in second-half stoppage time.

Just moving the ball was an adventure, especially in the first half. Conditions improved as the rain subsided after halftime, which saw stadium workers use squeegees to reduce the surface water.

But the damage was done for Canada early as the 19-year-old Shaw became the first U.S. woman to score in her first four starts.