Valls crashed three kilometres from the finish line on what was a rainy 156km course around Nice.
The 33-year-old is one of two riders to leave the Tour after the opening stage, with Lotto Soudal's John Degenkolb not permitted to start the second stage after trailing home outside the time limit.
"Unfortunately, Rafa Valls has withdrawn from the Tour de France after fracturing his right femur in a crash during today's opening stage," Bahrain McLaren confirmed in press release.
"All eight riders fought successfully through most of today's stage, despite the adverse weather conditions.
"However, Rafa was caught up in a high-speed crash on the Promenade des Anglais with just three kilometres to the finish line."
"Rafa was taken to hospital and has undergone surgery on his fractured femur, plus treatment for superficial wounds he sustained on his right shoulder, elbow, and knee," team doctor Carlo Guardascione added.
The Tour de France continues with Stage 2, a mountainous affair that will test the climbers' legs early. Stage 2 will be broadcast from 8.30pm AEST on SBS HD, with the stage depart from 8.50pm AEST on the SBS ŠKODA Tour Tracker App and SBS On Demand.