Nibali had bridged across to a move by Thibaut Pinot (FDJ) on the climb to Civiglo, before distancing his French rival on the descent and consolidating his lead on the run in to the final climb.
While Pinot was caught on the final small climb to San Fermo della Battaglia, Nibali continued to look strong as he held a comfortable lead to the finish in Como to the delight of the Italian crowds.
Julian Alaphilippe (Quick-Step Floors) took second place after attacking from a chase group on the final climb, while Gianni Moscon (Team Sky) sprinted to third place from a group of the other main contenders.
How it happened
The main break of the day consisted of six riders: Lorenzo Rota (Bardiani-CSF), Matthias Le Turnier (Cofidis), Pier Paolo De Negri (Nippo Vini Fantini), Lennard Hofstede (Team Sunweb), Jacques Janse Van Rensburg (Dimension Data), and Davide Ballerini (Androni-Sidermec), who took a little while to get away, but eventually opened their lead to a maximum of 12 minutes on the rolling first half of the 247km race.
Eventually it came down to Bahrain-Merida to begin to bring the lead down, the Middle Eastern team joined by Cannondale-Drapac and Movistar to just 1-17 as the race hit the base of the Madonna del Ghisallo climb with 70km remaining.
The start of the climb saw the start of the attacks, as a group of around eight riders attacked off the front of the peloton, which promptly split itself as Laurens de Plus (Quick-Step Floors) and Mickael Cherel (Ag2r La Mondiale) went on alone to mop up the disintegrating break, catching the last of the early escapees, Le Turnier, at the top of the climb.
That trio grew their lead on the descent towards the Muro di Sormano as a few more riders jumped out of the peloton to form an intermediate chase group, although with little more than a minute separating the peloton from the front of the race.
On to the Sormano and gesticulating at De Plus for not cooperating, Cherel accelerated to go solo at the front of the race. However the chasing group was going backwards as the peloton upped the pace behind, with Roglic the only rider able to put up much resistance, and was the last to be caught as the 25 per cent slopes really made themselves felt.
However Cherel was looking surprisingly fresh, cresting the climb with a 25-second lead over De Plus, with the peloton another 30-seconds back as they went on to the descent with 50km remaining.
The descent was technical and Cherel had a few close run-ins with the barriers, before De Plus had a disastrous moment as he took too much speed into a left-hand bend and went over the barriers, disappearing over the side of the road.
Medical services were quickly on the scene to tend to De Plus, and the rest of the riders safely made it back down onto valley roads with only Cherel left in the lead 50 seconds ahead of the peloton.
The next 20km were largely flat, but that didn't deter another attack from the peloton as Philipp Gilbert (Quick-Step Floors) accelerated clear with Alessandro De Marchi (BMC Racing), who were then joined by Pello Bilbao (Astana) to form a three-man group 20 seconds ahead of the peloton.
That group worked well together to catch Cherel, but the peloton was working hard behind with FDJ keeping the pressure on ahead of Astana and Bahrain-Merida.
FDJ continued to set the pace on the early slopes of the next climb to Civiglo as Cherel dropped back from the break, before the rest of the escapees were caught with 19km remaining in the race.
However the race didn't stay together for long as Gianni Moscon (Team Sky) tried to force the next selection with all of the main contenders forced to react. The Italian was quickly marked but Thibaut Pinot (FDJ) then made another move that looked more decisive.
The Frenchman quickly opened a sizeable gap, but that was made short work of by Vincenzo Nibali (Bahrain-Merida) who powered across from an elite chasing group.
Nibali led onto another technical descent and immediately started to push hard as he tried to distance Pinot, opening a lead of a seven seconds by the time the road flattened out with 10km remaining, and the chasing group another 40 seconds further back.
The final climb started with eight kilometres remaining and as the riders in the chase group refused to cooperate, the victory look set to be contested between Nibali and Pinot.
Both men were on their limit, but it was Nibali who was able to edge ahead second by second, cresting the final climb with a comfortable advantage.
Behind the attacks were still flying as Fabio Aru (Astana), Nairo Quintana (Movistar), and Diego Rosa (Team Sky) all tried their luck, but it was Julian Alaphilippe (Quick-Step Floors) who was able to catch Pinot by the top of the climb.
Alaphilippe pushed on on the descent, but he was riding for second place as Nibali enjoyed a solo victory in Como to the delight of the home crowds.
Nibali crossed the line to take the 50th win of his professional career 31 seconds ahead of Alaphilippe, while Gianni Moscon won the sprint for third place.
Il Lombardia 2017, Bergamo to Como (247km)
1. Vincenzo Nibali (Ita) Bahrain-Merida, in 6-15-29
2. Julian Alaphilippe (Fra) Quick-Step Floors, at 28 secs
3. Gianni Moscon (Ita) Team Sky, at 38 secs
4. Alexis Vuillermoz (Fra) Ag2r La Mondiale
5. Thibaut Pinot (Fra) FDJ
6. Domenico Pozzovivo (Ita) Ag2r La Mondiale
7. Fabio Aru (Ita) Astana, all at same time
8. Mikel Nieve (Esp) Team Sky, at 40 secs
9. Nairo Quintana (Col) Movistar, at 42 secs
10. Sergei Chernetski (Rus) Astana, at 47 secs
Wiebes takes a dominant win for DSM at the Ronde van Drenthe
DSM place four women in a final break of seven to guide the Dutch sprinter to her 13th race win of the season
By Owen Rogers •
'There’s nothing wrong with a bit of help': E-biking up the Great Orme on a father-son Tour of Britain
A product review of the Kinesis LYFE e-bike? A British cycling odyssey? Or perhaps just a complete and utter boondoggle?
By Jonny Long •
Strava data reveals huge performances from Fausto Masnada, Alejandro Valverde, and Mike Woods in Il Lombardia 2021
The KoM for the decisive penultimate climb fell in this year’s edition of the Italian Monument
By Alex Ballinger •
Five talking points from Il Lombardia 2021
Tadej Pogačar finishes the season on a high as he wins his second Monument
By Jonny Long •
Tadej Pogačar takes second Monument with victory at Il Lombardia 2021
The Slovenian beat Fausto Masnada in a two-up sprint
By Jonny Long •
Il Lombardia 2021 start list: Evenepoel, Alaphilippe, Pogačar and Roglič set to battle for the last Monument of the season
The list of riders down to take part in the 115th edition of Il Lombardia in Italy on Saturday, October 9
By Tim Bonville-Ginn •
Five things to look out for at Il Lombardia 2021
The final Monument of the season is here - don't miss these moments
By Stephen Puddicombe •
Julian Alaphilippe and Remco Evenepoel share their thoughts ahead of Il Lombardia 2021
The two Deceuninck - Quick-Step riders come into the final Monument of the year as two of the main favourites
By Tim Bonville-Ginn •
Vincenzo Nibali: 'My Giro started uphill and isn't getting much better'
Italian throws support behind team-mate Giulio Ciccone after crash on stage eight
By Richard Windsor •
The Monuments: Cycling’s five biggest one-day races
A guide to the five single-day pro bike races that make up cycling's Monuments
By Nigel Wynn •