Germany shocked the hockey world. (David W Cerny/Reuters)

Canada’s rough run at the Olympics got a whole lot worse Friday.

The two-time defending gold medalists in men’s hockey suffered a shocking 4-3 loss to relatively unheralded Germany in the semifinals, guaranteeing the hockey-mad country its worst finish at the Games in 12 years. One day earlier, the Canadian women’s hockey team lost to the United States in a shootout, ending its run of four straight gold medal finishes.

German men’s hockey players had never won more than a bronze medal in Olympic hockey, finishing third as a unified country in 1932 and replicating the feat as West Germany in 1976. The country failed to qualify for the Olympic tournament four years ago and finished no higher than sixth in the six Olympics that preceded those Sochi Games. The Germans were listed by oddsmakers as +386 moneyline underdogs before Friday’s game, implying just a 21 percent chance of victory.

With goals from Brooks Macek, Matthias Plachta, Frank Mauer and Patrick Hager, the Germans jumped to leads of 3-0 and 4-1 and staved off a furious empty-net barrage as the clock ticked down in the third period. Canada was playing without No. 1 goaltender Ben Scrivens, who was out with a shoulder/collarbone injury, but the loss could hardly be pinned on Canada’s goaltending. The team racked up 35 penalty minutes, and Gilbert Brule — who also scored for the Canadians — was ejected in the second period for a brutal hit to the head of Germany’s David Wolf at center ice. Two of Germany’s goals came on the power play.

Germany will play the Olympic Athletes from Russia for the gold medal Sunday. Canada will face the Czech Republic for the bronze Saturday.

Canada also failed to live up to its billing in curling. Its men’s team, winner of three straight gold medals, lost to the United States in the semifinals Thursday, then fell to Switzerland in the bronze medal match Friday. Its women’s team — the defending world champion — finished sixth in PyeongChang, failing to medal for the first time in the six Olympics in which women’s curling has been on the program.

Read more Winter Olympics coverage:

Barry Svrluga: Four more years? Olympians confront life after the Olympics.

Alina Zagitova, Evgenia Medvedeva finish 1-2 in women’s figure skating

Perspective: Judges choose Zagitova’s athleticism over Medvedeva’s artistry

For Olympic snowboarder Red Gerard, have medal will travel

Winter Olympics TV schedule and highlights