An hour after it ended, Pete Orr still wasn't sure what happened on the final play of Canada's gold-medal victory over the United States.

But with all the wildness going on in the 10th inning, who could blame him?

A botched pick-off attempt and a second throwing error in the bottom of the extra frame led to two runs as Canada's men's baseball team edged the U.S. 7-6 on Sunday to defend its Pan American baseball title.

BREAKING: David Huff's throwing error lets 2 runs score, CAN walks off with a 7-6 win in the 10th <a href="https://twitter.com/hashtag/CBCPanAm?src=hash">#CBCPanAm</a> <a href="http://t.co/AZszqnenbJ">http://t.co/AZszqnenbJ</a> —@cbcsports

"The way it ended, I'm still kind of confused," a beaming Orr said as a sparkling gold medal hung around his neck. "It doesn't feel like it's real but getting the medal at home, it's great. It's awesome."

The bottom half of the inning began ominously for the Canadians, with shortstop Sean Jamieson striking out on a failed bunt for the first out. But Orr turned things around with an RBI single, scoring Tyson Gillies to cut the American lead to 6-5.

Then the madness started.

U.S. pitcher David Huff tried to pick off Orr at first base but his throw went into right field to score Skyler Stromsmoe. Then the right-fielder's throw to third went over the third baseman's head, allowing Orr to score the winning run as the Canadians beat the Americans for Pan Am gold for the second straight Games.

The international tiebreaker was put in place in extra innings, meaning each team begins the frame with runners on first and second.

The three Canadian runs in the 10th were needed after the U.S. had taken a 6-4 lead in the top of the inning on Tyler Pastornicky's two-run single off Chris Leroux.

"Just score," manager Ernie Whitt said of what he was thinking during the error-filled extra frame. "You see the ball flying around and you just keep running the bases ... and we took advantage of their mistakes.

"Everyone was a little bit down after we didn't execute the bunt but again, as a staff we tell the players we still have two more outs to get and we're going to battle all the way through it."

Rene Tosoni hit a three-run shot for Canada and Jordan Lennerton had a sacrifice fly while left-hander Jeff Francis of North Delta, B.C., worked seven strong innings, giving up four runs on eight hits while striking out seven.

Andrew Albers pitched 2 1/3 innings and Leroux worked 2/3 of the 10th for the win.

Patrick Kivlehan had three hits for the U.S., including a two-run homer, and Albert Almora and Jacob Wilson had an RBI apiece.

American starter Josh Hader pitched three innings, giving up three runs on three hits while striking out three. Huff took the loss.

"It's hard to put in to words," said Francis, who before the Pan Ams hadn't pitched on the national team since the 2006 World Baseball Classic. "It's a crazy way to end a baseball game, a really good baseball game too.

"This was our goal and we did it. I think a lot of guys appreciate the kind of team we have. It isn't always pretty but we got it done."

The U.S. took a 2-0 lead in the second on Kivlehan's two-run homer and added another run in the third when Wilson drove in Andrew Parrino with a sacrifice fly.

Tosoni hit a three-run homer off Hader in the bottom of the third to tie the game 3-3 and Canada took its first lead in the bottom of the fifth. Again, Orr was involved.

The Richmond Hill, Ont., native single off pitcher Buddy Baumann, stole second base, advanced to third on a throwing error and crossed the plate on a sac fly from Lennerton.

"I'll tell you what, it's great to win and defend on our home soil," said Orr. "It just keeps getting better. The first one was great. This one here in front of our fans, was even better."

The U.S. made it a 4-4 game in the seventh as Almora drove in Kivlehan with a single that just got past Jamieson at shortstop.

Canada had a chance to add some runs in the bottom of the seventh, putting runners at first and third with one out. But Baumann struck out Tosoni and Casey Coleman got a ground out from pinch hitter Tim Smith to escape unscathed.

Earlier Sunday, Jose Garcia hit a walk-off home run in the bottom of the ninth to lift Cuba's men's baseball team to a 7-6 victory over Puerto Rico for the bronze medal.