Maxime Fournier, 21, was taking part in the race when he suddenly collapsed.
Emergency crews — including an emergency doctor — were unable to revive him.
François Lelièvre, the Shawinigan fire chief, says the whole community is in shock.
"He was somebody who trained a lot. He was really in shape," he said.
"It's really hard to understand how this could happen to such a young man."
This morning, a group of six runners got up early to finish the last kilometre of the marathon for Fournier.
The firefighters will be wearing stickers in memory of Fournier and the city's flag will be at half-mast.