Michael Guigou scored five times for France, which defeated Iceland in the gold medal match four years ago in Beijing. It is the first team to repeat as Olympic men's handball champion.
Niclas Ekberg had six goals as Sweden was again left with a silver medal. The Swedes finished as the runner-up in the 1992, '96 and 2000 Olympic Games.
France trailed midway through the first half, but made a key run late. Guigou had back-to-back goals, and Xavier Barachet followed up with another to make it a 10-7 game.
The French were up by two at halftime, then led throughout the second half -- albeit not by much. Sweden got within 21-20 in the 59th minute, after Ekberg tallied the second straight goal for his team. But Luc Abalo followed with a goal for France, a crucial score considering Kim Ekdahl du Rietz followed with one for Sweden.
But France and goalkeeper Thierry Omeyer made sure the Swedes didn't pull even, holding on as time ran out.