A former British army captain became on Monday the first known person to walk from the origin of the Amazon river to its mouth, after withstanding "50,000" mosquito bites, scorpion attacks and skin disease in his nearly 2-1/2 year odyssey.

Ed Stafford, a 34-year-old from Leicestershire, England, took 859 days to walk the length of the world's second-longest river, starting at the peak of Mount Mismi in Peru in April 2008.

He arrived at an Atlantic Ocean beach about 90 miles (150 km) northeast of the Brazilian city of Belem on Monday, despite collapsing from exhaustion with only 52 miles of the 6,000-mile journey to go.

Hours before completing the trek, Stafford's body broke out in a rash and he passed out by the roadside.

"I feel slightly humbled that my system just decided to shut down so close to the finish," he wrote on his blog at www.walkingtheamazon.com.

Stafford has aimed to use the walk to raise awareness about the threats to the Amazon rain forest and its people, using a portable satellite video to blog about his trek.

He had planned to complete the walk in about a year, but the journey was prolonged by floods that forced him to walk a roundabout route that was 2,000 miles longer than the 4,000-mile length of the Amazon, which is exceeded only by Africa's Nile as the world's longest river.

He began the journey with fellow British adventurer Luke Collyer, but the pair had a falling out early in the trek and Stafford continued alone. He was joined in July 2008 by a Peruvian forestry worker, Gadiel Cho Sanchez Rivera, who pledged to walk with him for five days and has been with him on the walk ever since.

A statement from Stafford's media team said that the Briton had been: "wrongly accused of murder on two separate occasions, been imprisoned, had concrete stuffed in his mouth by hostile tribes people, been chased by Ashaninka Indians with bows and arrows, been stung by hundreds of wasps and watched as his guide 'Cho' removed a botfly from Ed's head with superglue and a tree spine."

It said he had endured "50,000" mosquito bites, lived on a diet of piranha fish, rice and beans, and dodged a variety of snakes, electric eels, scorpions, and ants, and contracted a skin disfiguring disease.

Famed British explorer Sir Ranulph Fiennes was quoted as saying in the statement that Stafford's feat was "truly extraordinary." "No one has ever done this before and the pundits considered the route impossible," he said.