Britain's Chris Froome won the Tour de France for the fourth time as Dylan Groenewegen sprinted to victory in Paris on the 21st and final stage.
Groenewegen defeated German Andre Greipel in a frenetic final sprint on the Champs Elysees but the day belonged to 32-year-old Froome.
The Team Sky rider is now second in the all-time list after completing his third successive victory.
Rigoberto Uran was second, 54 seconds behind, with Romain Bardet third.
"Each time I have won has been so unique, such a different battle to get to this moment," said Froome afterwards.
"They are all so special but this will be remembered as the closest and most hard fought."
It was a largely processional stage before they reached Paris - with Yoann Offredo stopping to greet family and friends as the race passed close to his home and Cyril Gautier writing a marriage proposal on a piece on paper that was then broadcast on television.
But the stage ended in the expected bunch finish - with several teams trying to set up their sprinters before Lotto NL-Jumbo's Groenewegen held off his rivals to cross the line first.
Lotto Soudal's Greipel banged his head against his handlebars in frustration as he ended a Tour without a stage win for the first time.
- Is Froome Britain's least loved great sportsman?
- 'Froome can be force for years to come'
- BeSpoke: Download the Radio 5 live podcast
- In Short: Froome's popularity problem in France
How the race was won
An unusual thing happened to Froome during the 2017 Tour - he had the yellow jersey taken off him.
Froome cracked on the steep incline up to the summit finish at Peyragudes at the end of stage 12, losing 22 seconds to Italian Fabio Aru.
It gave Aru a six-second advantage and the rest of Froome's rivals hope that they could seriously threaten the 32-year-old for the first time in several years.
"I suffered in the Pyrenees and lost time on Peyragudes - but normally a bad day in the mountains you can lose three minutes," added Froome.
If his rivals thought Froome - who came into the race a little light on miles - was vulnerable he responded superbly, sprinting up to the finish in Rodez at the end of stage 14 to reclaim yellow from the tiring Aru.
Froome did not surrender the jersey again. The only time he was seriously threatened was when he had to stop to change a wheel shortly after he had been attacked by his rivals on stage 15 - but he managed to close the gap they had opened.
And even though there were only 29 seconds separating the top three of Froome, Bardet and Uran going into the time trial in Marseille on Saturday's penultimate stage, Froome had long ago regained control of the race.
|Froome's winning margins|
|2013: Defeats Nairo Quintana by four minutes 20 seconds|
|2015: Defeats Nairo Quintana by one minute 12 seconds|
|2016: Defeats Romain Bardet by four minutes five seconds|
|2017: Defeats Rigoberto Uran by 54 seconds|
"Every Tour is hard. It's difficult to say which was the hardest - every year you suffer. Definitely this was closest," he added after finishing third in the time trial to extend his lead.
Froome did not win a stage this year - becoming only the seventh rider to win a Tour without one - but does move second in the list of most Tour titles.
Only the legendary Jacques Anquetil, Eddy Merckx, Bernard Hinault and Miguel Indurain - all with five wins - stand above Froome.
And there are now only three men to have worn yellow on more days - Froome has worn it 59 times and moved above Anquetil on the all-time list during this year's Tour.
What about the other Britons?
It would have to be classed as a successful year for British riders at the Tour - although there are a few notable exceptions.
For the second successive year, a British rider not only topped the general classification but also claimed the white jersey given to the the best rider under the age of 26.
Last year it was Adam Yates who ended in white, but with the 24-year-old not in the 2017 race after riding the Giro d'Italia, where he finished ninth, his twin brother and fellow Orica-Scott rider Simon Yates claimed the jersey instead.
Dimension Data's Steve Cummings won stages in 2015 and 2016 and many of his fans avidly watched to see whether he would be able to get himself in the kind of breakaway that would give him the chance to complete the hat-trick, but it was not to be for the 36-year-old, who admitted he had been "disappointed" by his Tour.
At least Cummings made it to Paris - unlike his team-mate Mark Cavendish, who was well placed in a sprint before crashing into the barriers at the end of stage four.
Cavendish broke his right shoulder in the crash - in an incident that not only ended his Tour but also saw Peter Sagan controversially disqualified from the race.
Injury also ended the race of Sky's Geraint Thomas, the Welshman crashing on a fast decent and breaking his collarbone during the brutal ninth stage - one that also claimed Australian Richie Porte, another of the pre-race favourites.
But at least Thomas had won the opening stage's time trial in the German city of Dusseldorf, in the process taking yellow for the first time. Thomas held the jersey until the end of stage four.
Luke Rowe - Team Sky's third British rider - finished as the lanterne rouge, the rider in last place on general classification.
Fortuneo-Oscaro sprinter Dan McLay had been in last place but he abandoned on stage 17, while Scott Thwaites and Ben Swift both reached Paris, with the former 107th on the GC and the latter 83rd.
Who won the other jerseys?
The two remaining jerseys were both won by Team Sunweb, with the German team also picking up four stages, two each for Michael Matthews and Warren Barguil.
Green: Michael Matthews (Team Sunweb)
After Marcel Kittel claimed his fifth win of the Tour on stage 11, the German sprinter had a seemingly insurmountable lead in the green jersey points classification of 133 points over Matthews.
However, the Australian never gave up, going on the attack to pick up intermediate sprint points and after wins on stages 14 and 16, the Sunweb rider was just 29 points behind his Quick-Step rival.
Kittel was then forced to abandon after crashing early on stage 17, with Matthews pulling on the green jersey and soon building an unassailable lead of his own.
Sagan, who won the previous five points classifications, was disqualified for his part in a crash involving Cavendish, another former green jersey winner, on stage four.
Polka dot: Warren Barguil (Team Sunweb)
Barguil was distraught after being denied in a photo finish by Uran on stage nine, having thought he had won. The 25-year-old Frenchman responded in fine style, though, by utterly dominating the King of the Mountains classification.
He proved a deserving winner - building his total through two stage wins and long-range attacks to take points over the summits of some of the Tour's toughest climbs.
His victory on stage 13 meant he became the first French rider since 2005 to win on Bastille Day, while he became the first of any nationality to win a Tour stage at the summit of the Col d'Izoard on stage 18.
White: Simon Yates (Orica-Scott)
Yates took the white jersey off Pierre Latour at the end of stage four and kept it all the way to Paris.
His key rival for white was South African Louis Meintjes. The two finished one place apart in the general classification, with Yates seventh and Meintjes eighth.
Meintjes' last chance to seriously challenge his rival for white was Saturday's time trial through the streets of Marseille - but after 22.5km the two finished on exactly the same time.
|What's it worth?|
|Yellow jersey: £426,500 (500,000 euros), 2nd - £179,500 (200,000 euros), 3rd - £90,000 (100,000 euros)|
|Green jersey: £22,500 (25,000 euros)|
|Polka dot jersey: £22,500 (25,000 euros)|
|White jersey: £18,000 (20,000 euros)|
Analysis - 'The most exciting Tour for a while'
Former British cyclist and BBC summariser Rob Hayles
When you look at the fight for the yellow jersey, the competition has rarely been closer.
Until Kittel abandoned, the green jersey competition was shaping up to be very tight and Barguil has animated so many of the mountain stages in his fight for the polka dot jersey. So this Tour has been the most exciting for a while.
With the tight margins involved, this has definitely been Chris Froome's toughest victory.
He has never really been in a position at any point where he could relax and consider yellow in Paris a foregone conclusion.
Stage 15 - where Froome had to have a bike change while Bardet's team were trying to turn the screw - showed just how strong physically and mentally he has been at this year's Tour.
Everybody in the team played their part. Mikel Landa, Michal Kwiatkowski and Luke Rowe in particular were true professionals and that is what the Tour is about - not just the individual leader, but his team-mates all working for one goal.
Stage 20 result:
1. Dylan Groenewegen (Ned/LottoNL-Jumbo) 2hrs 25mins 39secs
2. Andre Greipel (Ger/Lotto-Soudal) Same Time
3. Edvald Boasson Hagen (Nor/Dimension Data)
4. Nacer Bouhanni (Fra/Cofidis)
5. Alexander Kristoff (Nor/Katusha-Alpecin)
6. Borut Bozic (Slo/Bahrain-Merida)
7. Davide Cimolai (Ita/FDJ)
8. Pierre-Luc Perichon (Fra/Fortuneo-Oscaro)
9. Ruediger Selig (Ger/BORA-hansgrohe)
10. Daniele Bennati (Ita/Movistar Team)
General classification after stage 21:
1. Chris Froome (GB/Team Sky) 86hrs 20mins 55secs
2. Rigoberto Uran (Col/Cannondale-Drapac) +54secs
3. Romain Bardet (Fra/AG2R La Mondiale) +2mins 20secs
4. Mikel Landa (Spa/Team Sky) +2mins 21secs
5. Fabio Aru (Ita/Astana) +3mins 05secs
6. Dan Martin (Ire/Quick-Step Floors) +4mins 42secs
7. Simon Yates (GB/Orica-Scott) +6mins 14secs
8. Louis Meintjes (SA/Team UAE Emirates) +8mins 20secs
9. Alberto Contador (Spa/Trek-Segafredo) +8mins 49secs
10. Warren Barguil (Fra/Team Sunweb) +9mins 25secs