Lappartient, the European Cycling Union (UEC) president, became the first Frenchman to take charge of the global body since Achille Joinard between 1947 and 1957.
French federation president from 2009-2017, Lappartient won 37 of the 45 votes by the UCI delegates at the governing body's congress during the road cycling world championships in Bergen, Norway.
In his pre-vote speech, Cookson, a Briton, promised to double UCI's investment in women's cycling, while the 44-year-old Lappartient vowed to get rid of the "corruption" that has left UCI with a "disastrous reputation".
"It is a great responsibility and I will endeavour in the next four years to be worthy of such trust," Lappartient said.
Cookson, a former British Cycling president, is the first UCI chief to serve only one term. He replaced Irishman Pat McQuaid in 2013 after promising to restore the credibility of cycling but his term was marked by several scandals.
Cookson came under fire this year after a UK anti-doping investigation was launched into Team Sky and former Tour de France winner Bradley Wiggins. Under scrutiny was the delivery to Sky in June 2011 of a medical package after the Dauphine-Libere race and ahead of that year’s Tour.
Wiggins and Team Sky have denied any doping violations. Cookson was on the operating board of Team Sky at the time.
Following the Lance Armstrong doping scandal, the Briton launched the Cycling Independent Reform Commission (CIRC) report. It found collusion between Armstrong and the UCI.
Armstrong was stripped of his seven Tour titles and banned for life from bicycle racing in 2012 by the U.S. Anti-Doping Agency after it accused him in a report of engineering one of the most sophisticated doping schemes in sports.
Armstrong, who had long denied using performance-enhancing drugs, admitted to doping in January 2013.
"The UCI I leave behind is unrecognisable from the organisation I took over in 2013 and I depart with my head held high," said Cookson.
“Someone needed to stand up and take on the previous regime, who had dragged cycling into the gutter and I leave the UCI knowing that I have delivered all the promises I made four years ago. "
Cookson also vowed to fight against technological fraud with stewards checking bikes with iPads adapted with magnets to detect hidden motors.
A joint report earlier this month, however, suggested the method, also criticised by several riders and team managers, was ineffective.
Lappartient promised he would take "a stronger stand in the fight against technological fraud" and also fight against illegal betting in a sport that has been rapidly developing worldwide, especially in Asia.
"I will be focused on guaranteeing the credibility of the results, especially on technological fraud," Lappartient told Reuters on Thursday.
The UCI implemented a system under which stewards check bikes with iPads adapted with magnets to detect hidden motors, but a joint report earlier this month suggested the method, also criticised by several riders and team managers, was ineffective.
"We were not professional enough on this subject and I will bring some new ideas to check the bikes and to be stronger on this subject. I don't want the UCI to be seen as weak in the fight against technological fraud," Lappartient said.
The 44-year-old Frenchman added he wants a method used by Tour de France organisers to be used more widely.
Tour organisers Amaury Sport Organisation (ASO) employed thermal cameras using atomic research technology in 2016 to detect motors in bikes, even if the motor is turned off.
Under Britain's Cookson, the relationship between the two organisations was cold at best, and Lappartient's election was greeted warmly by Tour de France director Christian Prudhomme.
"He is a man of action and I have no doubt he will be true to his word," Prudhomme said, adding there was "still a lot of work to do" to improve the sport's image.
"Let's work hand in hand to help the sport grow and make people dream but in order to do that, cycling must be credible," Prudhomme told Reuters.