Djokovic lost to Medvedev in the US Open final in September, with that defeat ending his hopes of a calendar Grand Slam.
But the Serbian, whose semi-final win over Hubert Hurkacz ensured he will be the year-end world number one for a record seventh time, got his revenge in France.
It marks a fifth title of the year and a sixth triumph at this event for Djokovic, who did not compete in the tournament last year – Medvedev winning it in his place.
The 34-year-old had it far from his own way, with Medvedev instantly going a break up, and although Djokovic hit back to draw level at 2-2, the world number two held off a second break point before nosing himself ahead at 4-3.
Yet having served out the first set at the first time of asking, the US Open champion slipped up in the fourth game of the second as Djokovic reeled off some superb returns, and he did not look back.
With the momentum and crowd on his side, Djokovic broke Medvedev twice in quick succession in the decider, and although he was denied claiming the win on his serve, it merely delayed the inevitable.
Medvedev's powerful serve was not enough, with Djokovic keeping his composure to seal a record-setting 37th Masters 1000 title with a sublime forehand into the corner of the court following a draining rally.