The Latvians took the lead 2 seconds before the end of the first half, when Mikas Indrašis scored the goal.
Oscar Batna doubled the gap in the middle of the second half.
Although the Canadians scored as many as 38 shots throughout the match, the Latvian goalkeeper withstood all the attempts of the favorites and the Latvians celebrated a historic victory.
This is the first time the Latvian national team has beaten Canada in an official match at a world championship or Olympic Games. By then, the Canadians had won 11 games in a row, and one ended in a draw.
The Canadian national team is the most titled team of all time in world championships. It has become 26 times the strongest on the planet. In the last championship two years ago, the Canadians finished second.
The Latvians have never been higher than the 7th place in the world championships so far.
The Latvian national team became the second group B team to win the first day of the championship. Earlier, the Germans defeated the Italians 9: 4.
Finland, Norway, Kazakhstan and the USA, which are defending the title, will also play in Group B.
Another match was played in Group A on Friday night. Slovakia defeated Belarus 5: 2.
The Slovaks led 3-0 after the first half and increased their lead to four goals at the beginning of the third quarter.
The Belarusians scored two goals in the last seven minutes, but were unable to fight more seriously for the victory, and the Slovaks closed the match at the last minute by scoring an empty goal.
Earlier in Group A, Russia achieved a dramatic victory 4: 3 against the Czech Republic.
Denmark, Sweden, Switzerland and Great Britain will also start in Group A tomorrow.