MARAPANIM, Brazil — After 859 days, thousands of miles and "50,000 mosquito bites," Ed Stafford became the first man known to have walked the entire length of the Amazon River when the waves of the Atlantic Ocean lapped at his feet in northern Brazil on Monday.

"It's unbelievable to be here!" Stafford told The Associated Press the moment he entered the sea. "It proves you can do anything — even if people say you cannot. I've proved that if you want something enough, you can do anything!"

A few hours earlier, Stafford had collapsed at the side of the road, just short of his destination. But upon arrival at the Crispim beach — and his journey's end — Stafford looked like he had all the energy in the world, as if walking for 2½ years were nothing as he jumped into the ocean and hugged anyone in sight.

While he says he is "no eco-warrior," Stafford told the AP near the end of his journey that he hoped his feat would raise awareness of destruction to the Amazon rain forest — but that at its heart, it was simply a grand expedition of endurance.

"The crux of it is, if this wasn't a selfish, boy's-own adventure, I don't think it would have worked," the 34-year-old former British army captain told the AP as he sat under the Brazilian sun near the jungle city of Belem. "I am simply doing it because no one has done it before."

There are at least six known expeditions along the course of the Amazon River, from its source high in the Peruvian Andes across Colombia and into Brazil before its waters are dumped into the ocean 4,200 miles (6,760 kilometers) away. But those used boats to advance their travel.

Stafford and a British friend began the walk on April 2, 2008, on the southern coast of Peru. Within three months, his pal left. Stafford carried on, walking bits of the route with hundreds of locals he met along the way. Eventually, Peruvian forestry worker Gadiel "Cho" Sanchez Rivera, 31, decided to make the journey with Stafford to the Atlantic.

Stafford said his journey — which has cost $100,000 and is paid for by sponsoring companies and donations — has deepened his understanding of the Amazon, its role in protecting the globe against climate change and the complex forces that are leading to its destruction.

He said he has seen vast swaths of demolished jungle.

"It's the people in power who are benefiting from the extraction of the natural resources here," Stafford said. "That's why there are corrupt politicians and laws that aren't enforced and loads of unconstrained deforestation still going on."

Despite the devastation, Stafford said he hopes things will change for the better.

"I think the average Brazilian is a lot more environmentally conscious than the people in power. I'm optimistic, I'm not pessimistic," he said.

He has lived off piranha fish he caught, rice and beans, and store-bought provisions found in local communities along the river.

To relax at night, Stafford said he has downloaded podcasts via Internet satellite phone by British comedian Ricky Gervais and episodes of the TV show "The Office".

Stafford and Rivera have encountered every conceivable danger, from 18-foot (5.5-meter) long caiman crocodiles, enormous anaconda snakes, illness, food shortages and the threat of drowning.

After they were welcomed in one Indian community in September 2008, the leaders offered to radio ahead to the next village for permission for Stafford and Rivera to walk through their territory.

"The response came back crystal clear. If a gringo walks into their community they will kill him," Stafford wrote on his blog at that time.

He decided to plan a route around the village, but he was still captured by Indians from another village and taken to their leaders.

After being dressed down and having their possessions thoroughly picked over — only a machete was confiscated — Stafford and Rivera's repeated explanations of the point of their expedition won over the Indians.

They were allowed to walk on the land, but only if they hired guides from the tribe.

Stafford said he plans another expedition in September 2011 — something nobody has ever done — but will not provide details for fear someone might beat him to it.

Until then, a good, long rest awaits.

"This expedition has been our lives. For 2½ years we've done nothing but walk and walk and walk. To wake up the morning after and know that we've done it will be a big change," said Stafford. "I think we'll get used to it though."

Associated Press Writer Bradley Brooks in Rio de Janeiro contributed to this report.