Canada will make their debut in the FIBA Basketball World Cup semi-finals after overpowering Slovenia 100-89 through a third-quarter rally as Germany edged past Latvia 81-79 on Wednesday to reach the final four.

In a battle of elite point guards, Luka Doncic and Slovenia went toe to toe with Shai Gilgeous-Alexander and Canada in a first half that ended level at 50-50.

Canada’s RJ Barrett and Gilgeous-Alexander bannered a 27-11 run by slashing their way to the cup in the third quarter. Canada led by as much as 16 points in the third and fourth quarters.

“We started getting stops defensively, been able to run transitions when we are at our best,” Gilgeous-Alexander, an NBA All-Star who posted game-highs of 31 points and 10 rebounds, told reporters. “We are not satisfied, we want to win gold.”

Doncic, who plays for the Dallas Mavericks, led Slovenia with 26 points, four rebounds and five assists before a disqualifying second technical foul with 6:37 minutes left in the final quarter.

Germany will play the United States and Serbia will face Canada on Friday in Manila.

Germany narrowly beat Latvia despite a sub-par performance from team captain Dennis Schroder.

Latvia forward Davis Bertans missed a game-winning three-pointer at the final buzzer that could have completed their recovery from 70-59 down early in the fourth quarter.

Germany’s Schroder hit just four of 26 shots, including zero of eight from distance.

“That’s probably the worst game I’ve ever played in my career,” Schroder told reporters.

Four of Germany’s players scored in double-digits, led by Orlando Magic guard Franz Wagner who contributed 16 points, eight rebounds and three assists.

Debutants Latvia were the tournament’s giant-slayers, recording upset wins over Brazil, France, and defending champions Spain.

FIBA’s quadrennial flagship event will end with the crowning of a new champion on Sunday in Manila.