After spotting the 19-year-old Medina the early lead in the final heat, Fanning, 32, turned a bumpy wave that was breaking to the right into an 8.83 score that gave him a 16.66-15.00 victory.
Waves at Le Penon Friday were breaking around 3-4 feet.
"Conditions deteriorated towards the end, but I was a little lucky with that last wave I guess," said Fanning, a two-world champion and four-time winner of the Quicksilver Pro France. "I just thought I'd stick to my game and it sort of paid off towards the end."
The win was the first of the season for Fanning, who has nevertheless been surfing well enough to lead the Association of Surfing Professionals World Championship Tour points race with 51,900. American Kelly Slater is in second with 45,900 points.
Medina moved up to 15th place and fellow Brazilian Felipe Toledo, who finished third this week, climbed into 16th place.
The ASP WCT tour resumes next week in Portugal.
Kate Middleton recycles dress at movie premiere
Gal Gadot cast as Wonder Woman for 'Batman vs. Superman'