The Garmin-Sharp team said the Canadian withdrew before the start of Friday's 13th stage due to a "deteriorating physical condition."
The Victoria native, who became the first Canadian to win a Grand Tour race last year, has dropped down the overall standings in recent days. He fell into 37th place after finishing 183rd in Thursday's stage, and was over 32 minutes off the lead.
Hesjedal was third overall just a week ago. But the challenging Stage-8 time trial appeared to be the turning point and he was not able to get back on track.
"I want to be here for my team and for all the people who have supported me to get me here to this point," Hesjedal said Friday. "I built my entire season around the Giro and I came here feeling great, but I have been suffering since the TT. We're working on it, but we're not sure what's wrong. There's a virus that's been going around, so it could be that, or severe allergies, or going too deep on the TT combined with both.
"Whatever it is, I'm only getting worse," Hesjedal added. "Yesterday's stage was just too much for me. I fought to get through it and I know everyone suffered but after seeing the medical staff last night, I also know that it's time for me to go home, get some tests done and get healthy again."
Tour de France champion Bradley Wiggins also withdrew on the advice of the team physician due to "a worsening chest infection."
Britain's Mark Cavendish sprinted to victory in the 13th and longest stage of the race on Friday. Italy's Vincenzo Nibali kept the overall lead, boosting his chances of winning his home country's biggest cycling race for the first time.
Team Sky said Wiggins' condition has been getting worse.
"We monitored Bradley overnight and this morning we've withdrawn him from the Giro after consulting the team doctor," Team Sky general manager Dave Brailsford said. "His chest infection has been getting worse and our primary concern is always the health of our riders. Bradley will return to the UK today for treatment and to rest and we hope to have him back on the road as soon as possible."
Wiggins struggled throughout the Giro, both on rainy descents and on steep climbs. He lost more than three minutes in Thursday's rainy stage and left the race in 13th place.
"As a passionate racer he wanted to continue but he is simply unable to do so on medical grounds," Brailsford said.
Wiggins is expected to help teammate Chris Froome at the Tour this year but he said before leaving for Italy that he might grab the team leadership in France himself and try to defend his title. That prompted Sky to issue a statement saying that Froome will be the team leader for the French race.
In last year's Tour, Froome finished runner-up to Wiggins.
The race hits the mountains again over the weekend, with Saturday's stage climbing Sestriere and Bardonecchia and Sunday taking riders into France and up the Col du Galibier, which is often included in the Tour.
The race ends May 26 in Brescia.
With files from The Canadian Press.