The 30-year-old also took the opportunity to mend his fences with current race leader Lance Armstrong, whom he had accused of disrespect when the American said he had allowed the Italian to win last week's stage to the climber's paradise of Mont Ventoux.
However, Armstrong, who finally cracked in Stage 16 but still holds a lead of over five minutes on German Jan Ullrich, did not reciprocate and stated that the Italian was a man that no one in the rest of the peloton could understand.
"Pantani is different. No one can ever understand his motivation for what he does," Armstrong said. "Anyway, it's his problem that he has retired. I came here to win the Tour."
Pantani, who had regained his self-respect with two stage wins in this year's race following the humiliation of failing a blood test on the penultimate day of last year's Tour of Italy, admitted that he had no energy left.
"There is no way I can carry on. I am completely empty," he said. "I don't know what caused it, it could have been a cold drink I suppose. The symptoms were not very pleasant but my stomach blew up and then I went down with dysentery."
Pantani had started suffering during the 16th stage of the race from Courchevel to Morzine, which was won by controversial French rider Richard Virenque.
His Mercatone Uno team doctor diagnosed that he was suffering from dysentery and advised him not to leave on the 17th stage Wednesday to Evian-les-Bains.
Pantani, who set off on a foolhardy 80 kilometer escape early in Tuesday's stage, angered by race leader Lance Armstrong's remarks that he let him win last Thursday's stage to Mount Ventoux, had looked back to his best when he came home alone to win Sunday's 173.5-kilometers Alpine ride from Briancon to Courchevel.
However, despite their disagreement Pantani paid a handsome tribute to the 28-year-old reigning champion.
"I think he dishonored my win in Mount Ventoux, but nevertheless he will be a worthy winner and I think it is going to be very hard to find another rider who is as strong as him in the years to come," he said.
The shaven-headed Italian, nicknamed "the Pirate," has taken part in the Tour de France five times since 1994 but has never before been forced to drop out. He refused to admit that his effort early in Tuesday's stage had been a waste of time.
"Some people would say I am crazy, but I had to do it as I knew I wasn't feeling well and if I had to retire I wanted to do it with my head held high and having provoked a real racing stage," he said.
The charismatic Italian, who faces a court appearance in October on charges of sporting fraud where it is alleged he used banned substances in the 1995 Milan-Turin race, said that his superb performances in the Tour had regenerated his career.
"My two great victories have completely changed my mindset and made me want to be the best again," said Pantani, who had considered retiring after his fall into disgrace last year.
"Now I have rebuilt my rapport with my teammates and that makes me optimistic for the future," he added.
Pantani, who said he may well participate in the Olympic Games in Sydney in September, was in 14th place in the overall standings, 20 minutes, 46 seconds behind Armstrong.