Nibali crashed with 3.8km remaining as the riders climbed towards the summit finish in the ski resort of Alpe d’Huez, hitting the deck as police motorbikes slowed ahead of him while he tried to respond to an attack by Chris Froome.
The Italian rider staged an impressive recovery on the stage, climbing back onto his bike and nearly catching the lead riders in the final kilometres, only finishing 13 seconds behind stage winner Geraint Thomas.
That result left him sitting in fourth place overall, just 2-37 off the yellow jersey of Thomas. However he was taken to hospital after the stage for examinations, where it was confirmed that he had suffered a fractured vertebra and would be forced to abandoned the race.
His Bahrain-Merida team confirmed that Nibali would not continue in the race, as Dan Martin in 2017 and Lawson Craddock in 2018 have both done with fractured vertebrae, and will instead return home to Italy for further examinations.
Watch: Tour de France 2018 stage 12 highlights
Writing on Twitter, Nibali thanked fans for their support and began to look forward to objectives later in the season.
“Hello guys, I am returning to the hotel but unfortunately the outcome of the medical report is not good,” Nibali wrote. “It was confirmed that I had suffered a fractured vertebra, and tomorrow I will return home for a period of recovery. Thank you for all your affection shown to me! Until next time…”
Nibali is the third general classification to be forced to abandon the 2018 Tour de France, after Richie Porte pulled out with a broken collarbone following a crash on stage nine, and Rigoberto Uran – second last year behind Chris Froome – did not start stage 12 as he continued to suffer from a crash on the cobbled stage to Roubaix.