Then Abdoulaye Camara, from the poor West African country of Mauritania, asked U.S. officials for asylum.
Camara's arduous journey highlights how immigration to the United States through its southern border is evolving. Instead of being almost exclusively people from Latin America, the stream of migrants crossing the Mexican border these days includes many who come from the other side of the world.
Almost 3,000 citizens of India were apprehended entering the U.S. from Mexico last year. In 2007, only 76 were. The number of Nepalese rose from just four in 2007 to 647 last year. More people from Africa are also seeking to get into the United States, with hundreds having reached Mexican towns across the border from Texas in recent weeks, according to local news reports from both sides of the border.
Camara's journey began more than a year ago in the small town of Toulel, in southern Mauritania. He left Mauritania, where slavery is illegal but still practiced, "because it's a country that doesn't know human rights," he said.
Camara was one of 124 migrants who ended up in a federal prison in Oregon after being detained in the U.S. near the border with Mexico in May, the result of the Trump administration's zero tolerance policy.
He was released Oct. 3, after he had passed his "credible fear" exam, the first step on obtaining asylum, and members of the community near the prison donated money for his bond. He was assisted by lawyers working pro bono.
"My heart is so gracious, and I am so happy. I really thank my lawyers who got me out of that detention," Camara said in French as he rode in a car away from the prison.
Camara's journey was epic, yet more people are making similar treks to reach the United States. It took him from his village on the edge of the Sahara desert to Morocco by plane and then a flight to Brazil. He stayed there 15 months, picking apples in orchards and saving his earnings as best he could. Finally he felt he had enough to make it to the United States.
All that lay between him and the U.S. border was 6,000 miles (9,700 kilometers).
"It was very, very difficult," said Camara, 30. "I climbed mountains, I crossed rivers. I crossed many rivers, the sea."
Camara learned Portuguese in Brazil and could understand a lot of Spanish, which is similar, but not speak it very well. He rode buses through Brazil, Peru and Colombia. Then he and others on the migrant trail faced the most serious obstacle: the Darien Gap, a 60-mile (97-kilometer) stretch of roadless jungle straddling the border of Colombia and Panama.
But first, he and other travelers who gathered in the town of Turbo, Colombia, had to cross the Gulf of Uraba, a long and wide inlet from the Caribbean Sea. Turbo, on its southeast shore, has become a major point on the migrant trail, where travelers can resupply and where human smugglers offer boat rides.
Camara and about 75 other people boarded a launch for Capurgana, a village next to the Panamanian border on the other end of the gulf.
While the slow-moving boat was far from shore, the seas got very rough.
"There was a wave that came and tipped over the canoe," Camara said. "Five people fell into the water, and they couldn't swim."
They all drowned, he said. The survivors pushed on.
Finally arriving in Capurgana after spending two nights on the boat, the migrants split into smaller groups to cross the infamous Darien Gap, a wild place that has tested the most seasoned of travelers. The thick jungle hides swamps that can swallow a man. Lost travelers have died, and been devoured, boots and all, by packs of wild boars, or have been found, half out of their minds.
Camara's group consisted of 37 people, including women - two of them pregnant, one from Cameroon and one from Congo - and children.
"We walked seven days and climbed up into the mountains, into the forest," Camara said. "When it was night, we slept on the ground. We just kept walking and sleeping, walking and sleeping. It was hard."
One man, who was around 26 and from the African nation of Guinea, died, perhaps from exhaustion combined with thirst, Camara said.
By the sixth day, all the drinks the group had brought with them were gone. They drank water from a river. They came across a Panamanian man and his wife, who sold them some bananas for $5, Camara said.
Once he got out of the jungle, Camara went to Panamanian immigration officials who gave him travel documents enabling him to go on to Costa Rica, which he reached by bus. In Costa Rica, he repeated that process in hopes of going on to Nicaragua. But he heard authorities there were not so accommodating, so he and about 100 other migrants took a boat around Nicaragua, traveling at night along its Pacific coast.
"All we could see were the lights of Nicaragua," he said. Then it was over land again, in cars, buses and sometimes on foot, across Honduras, Guatemala and Mexico, all the way to the U.S. border at Tijuana. He was just about out of money and spent the night in a migrant shelter.
On May 20, he crossed into San Ysidro, south of San Diego.
"I said, 'I came, I came. I'm from Africa. I want help,'" he said.
He is going to stay with a brother in Philadelphia while he pursues his asylum request.
Andrew Selsky on Twitter: https://twitter.com/andrewselsky
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.