A nation gripped by grief, Italy said goodbye to one of its favourite sporting sons on Wednesday.

Roughly 20,000 mourners gathered outside a small church in the Adriatic town of Cesenatico at the funeral of Marco Pantani, an enormously popular Italian cyclist.

Pantani, the 1998 Tour de France and Giro d'Italia winner, was found dead Saturday in a hotel room in the Italian seaside resort of Rimini.

Disturbing notes that Pantani wrote in his passport were read aloud during the funeral service by his friend and manager Manuela Ronchi.

"For four years I've been in every court, I just lost my desire to be like all the other sportsmen," the note read. "But cycling has paid and many youngsters have lost their faith in justice."

"All my colleagues have been humiliated, with TV cameras hidden in their hotel rooms to try and ruin families. How could you not hurt yourself after that?"

Pantani's entire Mercatone Uno team, national cycling coach Franco Ballerini, retired skier Alberto Tomba, former national soccer coach Azeglio Vicini and a host of cyclists were among the mourners Wednesday

Former cycling world champion Mario Cipollini, current world champion Igor Astarloa and soccer great Diego Maradona also paid their final respects in Cesenatico which was draped with dozens of banners paying tribute to the Italian cycling legend.

Many mourners wore a bandanna around their arms in tribute of Pantani who was famous for wearing one on his bald head – a fashion statement which, along with his hoop earring, earned him the nickname of "il pirata," "the pirate."

One town official estimated that roughly 3,000 people had strolled passed Pantani's casket, leaving flowers and notes or silently praying. The funeral was held in the same church and town officials set up speakers outside the church for mourners who couldn't fit inside.

Autopsy information released Monday stated that Pantani died of a heart attack following severe swelling of the heart and brain.

Pantani's heart and breathing stopped after "cerebral and pulmonary edema," Dr. Giuseppe Fortuni told the Italian news agency ANSA. A cerebral edema is an excess of water on the brain.

The three-hour autopsy also revealed the 34-year-old Pantani had lung damage. It remains unclear why Pantani suffered these catastrophic symptoms.

"Two elements have emerged, bleeding in the brain and lungs. At this point we can exclude violence," Fortuni told the BBC Monday.

Fortuni, who was involved in the autopsy, said further tests would be required.

"The investigations will take weeks. Samples will be analyzed to evaluate and complete the investigations."

Pantani had been plagued by doping accusations in recent years and reportedly had previous struggles with depression. But prosecutors have played down the possibility of suicide.

Rimini police investigator Sabato Riccio said at least 10 bottles of tranquilizers were found in Pantani's room. Some containers were open and others were empty, according to police.

Fortuni said authorities have not yet found signs linking Pantani's death to drug use, but the possibility has not been ruled out.

"We will investigate everything," said Fortuni. "No hypothesis has been excluded."

Pantani was the last man to win cycling's most prestigious races – the Tour de France and Giro d'Italia – in the same year.

with files from Canadian Press