Sanchez had started the day in seventh position overall, and was looking like he would move up the GC after posting top 10 times at the first and second time checks.
Disaster struck for the Spaniard with just 7km to go on the stage, as he spectacularly slid out on a corner at high speed, landing heavily on his side.
Remarkably, Sanchez remounted his bike and rode to the finish. He was then taken immediately to hospital.
“I had a brutal crash with 7km to go in a corner to right," Sanchez said in a team statement.
"I was doing a good TT and I think I was able to finish it in the top 5 or 6 and gain some GC positions. Right now the physical pain is nothing compared to my soul. I am only two days from the final and we did a big sacrifice to be here fighting with the best riders.
"I know this is sport and cycling but it's hard to accept it now. The important thing is I haven't broken anything even if my right shoulder is dislocated. I hope to recover fast and give my best in this final of season in the Italian races in October.”
It's a second blow for BMC, who lost Tejay van Garderen from its Vuelta squad on stage 17 when the American withdrew due to fatigue.
The squad's highest-ranked rider is now Ben Hermans, in 14th place overall and 13-18 behind race leader Nairo Quintana (Movistar). The squad were also leading the team classification prior to Sanchez's withdrawal.
The Vuelta a España continues on Saturday with the final mountain stage, before the race finale in Madrid on Sunday. Quintana leads time trial winner Chris Froome (Sky) by 1-21 in the general classification.
Thank you for reading 10 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1