Team USA is going to Miami.

With a spot in the second round of the World Baseball Classic on the line, the U.S. came from behind twice on Sunday to defeat Canada, 9-4, at Chase Field.

The Americans, who scored three times in the eighth on an Adam Jones two-run double and Shane Victorino's RBI single, will move on to Marlins Park from Pool D along with Italy to meet the Dominican Republic and Puerto Rico. Jonathan Lucroy added an RBI single in the ninth before Eric Hosmer put the game out of reach with a bases-clearing double.

They narrowly avoided their earliest exit from the tournament, now in its third running. The Canadians still haven't made it out of the first round. Mexico was the other team that didn't survive the pool this weekend.

The U.S. is the top seed out of this bracket heading to Miami and will play an 8 p.m. ET game on Tuesday against either the D.R. or Puerto Rico. Italy will play in the 1 p.m. ET game.

Canada took a 2-0 lead in the second inning on a two-run homer by Michael Saunders off left-hander Derek Holland, who went five innings, allowing four hits and left with the score tied at 2.

The U.S. scored twice in the fifth off Canada starter Jameson Taillon, taking advantage of a throwing error by third baseman Taylor Green. The second run came home on a Jones sacrifice fly.