The 23-year-old police moved to the top podium position with a composed final run but Loch needed only to complete an error-free effort at the Olympic Sliding Centre to be assured of his golden hat-trick for Germany.
Surprise package David Gleirscher claimed Austria's first Olympic luge gold in 50 years at the Pyeongchang Games on Sunday after 2014 champion Felix Loch stumbled dramatically with his third successive title in sight.
Mazdzer won silver in the men's singles luge - becoming the first American to medal in the event.
Chasing a third straight gold medal in the event, Loch came into the fourth and final run with a 0.192-second advantage over Chris Mazdzer of the United States, who led Gleirscher by 0.020.
Mazdzer had a little trouble in run 4, but held it together and it looked like he would end up with a bronze medal.
NPR's Melissa Block reports he leaped from his sled after that final run, vaulting "into the stands to hug his family and grab an American flag".
After the first two runs on February 10, Loch led by 0.188 over Gleirscher and by 0.217 over Repilov.
Any medal finish would be a huge accomplishment for Mazdzer, whose best finish in the recent World Cup was sixth place despite being ranked No. 3 in the world during the 2015-2016 season. Tucker West finished 26th and Taylor Morris finished 18th. He won a singles medal in luge, taking the silver.
German Felix Loch has dominated the men's downhill luge at the Winter Olympics, and had won the Olympic gold on both of his previous attempts. Germany's Johannes Ludwig took bronze, finishing 0.204 behind the American silver medalist.