MARAPANIM, Brazil — He fought tropical disease and deadly snakes, was held captive at one point and collapsed just short of his goal.

Still, Ed Stafford ended his 2½-year journey Monday as he planned — leaping into the sea as the first man known to walk the length of the Amazon River.

“I’ve been told I was going to be killed so many times,” the 34-year-old former British army captain told The Associated Press. “But I’m not dead. I’m here now and I’ve proved that if you want something enough, you can do anything!”

Stafford had collapsed at the side of the road early Sunday, just 53 miles short of his destination. He was back on his feet after a few hours of rest, however, and looked like he had all the energy in the world as he ran into the Atlantic Ocean at Crispim beach Monday morning in northern Brazil – popping champagne and spraying Peruvian forestry worker Gadiel “Cho” Sanchez Rivera, his expedition partner.

It was not the quest of an eco-warrior, Stafford is quick to point out, though he hopes the feat will raise awareness of the Amazon and the complex forces that are leading to its destruction.

Rather, it was the personal challenge for a man who left the military to be a stockbroker, was bored by finance and ended up leading expeditions in Belize, then supervising the building of a BBC base camp in Guyana.

“The crux of it is, if this wasn’t a selfish, boy’s-own adventure, I don’t think it would have worked,” he said before completing his quest. “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 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. Sanchez Rivera, 31, joined him a few months into the walk — which cost $100,000 and was paid for by sponsors and donations — and completed it with him.

Stafford saw vast swaths of demolished jungle on the journey, deepening his understanding of the Amazon, its role in protecting the globe against climate change and the complex forces behind its destruction.

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

To relax at night, he downloaded podcasts by comedian Ricky Gervais and episodes of the “The Office” by satellite phone.

Stafford and Sanchez Rivera encountered 18-foot caimans, enormous anacondas, illness, food shortages.

They found themselves in the territory of Indians who remain distrustful of outsiders after suffering extreme violence under Peru’s Shining Path terrorists.

After being dressed down and having their possessions thoroughly picked over – only a machete was confiscated – their repeated explanations of their purpose won over the Indians.