The hosts Sweden had earlier missed out on the bronze, losing 23-24 to Spain in their play off clash.
The French achievement in becoming the first country to win four consecutive titles is all the more astonishing as they were languishing in the third division at world level 30 years ago.
The French – already Olympic, European and reigning world champions – were pushed all the way by a resilient Danish team, who levelled the match at 31 apiece with just four seconds remaining of normal time.
However, the titleholders – whose predecessors had also been pushed into extra-time in the 2001 final by Sweden before they prevailed – regained their composure.
Having been helped along during normal time largely by 11 goals from player of the tournament Nikola Karabatic, it was captain fantastic Jerome Fernandez who delivered when it mattered in extra-time as he scored two crucial goals.
Victory gains the winners direct qualification to both the 2012 Olympics in London and the next world championships in 2013 in Spain.