Team Sky's British rider Geraint Thomas has pulled out of the Giro d'Italia as a result of the crash he suffered on Sunday's stage.

Thomas crashed in a pile-up involving a police motorbike, having started the ninth stage in second place overall.

He had a scan on a shoulder injury on Monday's rest day and went on to finish second in Tuesday's time trial.

But he said continuing further "would be a case of trying to survive each day rather than racing".

"Obviously it's never nice to leave a race early, especially when it's your main goal of the season, but I have to look at the bigger picture," he added.

"I'd love to continue, but I've been suffering since my crash on Sunday. I've had an issue with my shoulder which is manageable, but my knee has also been getting worse each day."

Thomas, given licence to compete for overall victory for the first time at one of cycling's three grand tours, finished more than five minutes behind stage winner and race favourite Nairo Quintana on Sunday's summit finish.

He had started the day level on time with the Colombian, and 10 seconds behind then-race leader Bob Jungels.

But he was taken out 15km from Sunday's finish when Dutchman Wilco Kelderman was unable to avoid a police motorbike that had stopped at the side of the road, hitting the officer with his shoulder.

That caused Kelderman to swerve to his right into the Sky riders, who were in a line in the peloton, and resulted in several of the British-based team being brought down.

Thomas finished the day more than five minutes behind Quintana but made up more than two minutes during Tuesday's individual race against the clock.

However, he lost more than one minute during Wednesday and Thursday's stages.

He was six minutes and 46 seconds behind race leader Tom Dumoulin, and more than four minutes adrift of second-placed Quintana, when he pulled out before Friday's stage 13. The 21-stage race finishes on Sunday, 28 May in Milan.

Competing at the 2013 Tour de France, Thomas suffered a broken pelvis in a crash on the opening stage.

But he continued to ride for the duration of the three-week, 21-stage race, as team-mate Chris Froome claimed the first of his three victories.

Analysis

BBC Sport's Dafydd Pritchard at the Giro d'Italia

Crashing out of a race is nothing new for Geraint Thomas but his withdrawal from the Giro d'Italia is a devastating blow.

The Welshman was leading Team Sky at a Grand Tour for the first time in his career, an opportunity for which he had worked long and hard to earn.

All appeared to be going according to plan in the early stages, with Thomas second in the general classification and his usual nonchalant self despite the increased scrutiny on him in Italy.

Then disaster struck on Sunday, with the crash that effectively ended the 30-year-old's hopes of victory, through no fault of his own.

First there was anger, then a determination to recover, but the overriding emotion for Thomas was one of frustration.

We will never know how he might have fared had he kept in touch with the likes of pre-race favourite Nairo Quintana; how he might have competed for a podium finish - or better - in the final week.

The question of 'what if' will play on his mind but, as Thomas says, he will be back and ready to support Chris Froome at the Tour de France in July.