Open this photo in gallery:

Canadian players celebrate at the end of a World Baseball Classic win over Cuba in San Juan, Puerto Rico on Wednesday.Fernando Llano/The Associated Press

Canada advanced past the first round of the World Baseball Classic for the first time, beating Cuba 7-2 Wednesday in a winner-take-all game at San Juan, Puerto Rico, behind Abraham Toro’s homer and Otto Lopez’s two-run single.

Brothers Bo Naylor and Josh Naylor drove in runs, Owen Caissie had two RBIs and reliever James Paxton struck out six over 2 2/3 scoreless innings for Canada (3-1), which eliminated the Cubans (2-2) and won Group A over Puerto Rico (3-1). Cuba was knocked out in the first round for the first time.

Canada and Puerto Rico will play in the quarter-finals in Houston this weekend.

Cuba finished with three errors, and left fielder Ariel Martinez allowed Toro’s catchable fly starting the seventh to fall for a double. The Canadians broke open the game with a three-run sixth inning that included a dropped popup, a foul pop that fell, a wild pickoff throw and a catcher’s interference call on Andrys Perez, whose passed ball led to Canada’s first run.

Later Wednesday, Mexico and Italy were to play at Houston in a Group B game that will determine whether the U.S. advances.

Open this photo in gallery:

Canada’s Otto Lopez runs toward home plate to score against Cuba during the eighth inning of their World Baseball Classic game in San Juan, Puerto Rico on Wednesday.Fernando Llano/The Associated Press

Cuba escaped a bases-loaded jam in the first when Matt Davidson hit an inning-ending popout off loser Livan Moinelo, but Canada went ahead in the third on Caissie’s sacrifice fly. Toro homered in the fifth on a splitter from Yariel Rodríguez, a 420-foot drive to right.

Cuba scored in the bottom half on Yoelkis Guibert’s run-scoring groundout off winner Cal Quantrill, who allowed an unearned run and two hits over five innings.

Canada opened a 3-1 lead in the sixth on Bo Naylor’s RBI double.

Martinez drove in a run in the bottom half with his third hit and Josh Naylor had an RBI single in the seventh on a soft fly to left that popped up of the glove of Martinez, who tried for a sliding catch.

Cuba went 1 for 7 with runners in scoring position. Adam Macko escaped a bases-loaded jam in the sixth when Yiddi Cappe swung over a curveball and James Paxton struck out Moncada in the seventh to leave runners at the corners.