Tom Dumoulin celebrated earning a unique place in the history books after taking the Giro d'Italia title despite losing time to go "pooping in the woods".

The Dutch rider had to stop to relieve his troublesome stomach problems on stage 16 and that saw his general classification lead cut by more than two minutes, putting his pink jersey under threat.

It was an incident that led to much debate, as the lead group attacked when the Team Sunweb rider was indisposed, but Dumoulin kept his nerve to see out a maiden Grand Tour triumph with a superb final-stage time trial that pushed Nairo Quintana down to second.

"I still made history by s***ting in the wood, but now [also] in a positive way," said the 26-year-old. "I will go down in the history books for winning the Giro after pooping in the woods. It's quite amazing.

"I lost only two minutes in the last 30 kilometres, actually only 40 seconds after my incident, so after that, I thought, 'Maybe I'm better than I thought'. But it was still a long way, although I knew there was still the time trial."

Dumoulin's success brought a dramatic 100th edition of the Giro to a close in style and he confessed to being surprised by his victory.

"No, I never expected to win the Giro," he said. "Maybe somewhere in the future, maybe one time with a lot of luck or whatever, but not this year.

"I would have been very happy with a place in the top 10."