A boy wears the U.S. colours in Havana, Cuba, January 12, 2017. REUTERS/Stringer

TODAY CUBA (Reuters) Cuban Jose Enrique Manreza, who sold his house and belongings to embark on a epic journey by plane, bus and on foot in pursuit of the American dream, is now stranded in a Mexican border town after Washington abruptly ended a lenient immigration policy.

U.S. President Barack Obama on Thursday repealed a measure granting automatic residency to virtually every Cuban who arrived in the United States, whether or not they had visas, ending a longstanding exception to U.S. policy.

The end of the “wet foot, dry foot” policy, which allowed any Cuban who reached U.S. soil to stay, but returned any picked up at sea, took effect immediately.

“Imagine how I feel, after I spent six days and six nights running through rivers and jungles in the humidity,” said Manreza, at a migrant shelter in the southern Mexican city of Tapachula, where he heard the news, along with 30 other Cubans.

Manreza estimated he had spent about $10,000 on his trip, including a flight to French Guiana, guides through South America and bribes to fend off aggressors who tried to abuse his daughter on the journey.

“I had to give them lots and lots of money, and now this happens,” said Manreza, who ran a soda warehouse in Havana before he left in December. He said he was deciding whether to return to Cuba, broke, or seek asylum in Mexico.

Anticipating the end of the policy, Cuban immigration has surged since the 2014 normalization, and Ben Rhodes, Obama’s deputy national security adviser, said some 40,000 Cubans arrived in the United States in 2015 and about 54,000 in 2016.

Numbers have been lower in recent months, but Cubans en route in Panama said hundreds more were behind them in the treacherous jungles of the Darien.

“There are people with children, pregnant women, elderly people,” said Gabriel Alejandro Marín, part of a group of 50 in Panama City. “We have all sold everything for this.”

Thousands of Cubans gathered in Costa Rica and Panama last year as Central American countries struggled to cope with the influx. El Salvador on Thursday welcomed the new policy, saying all immigrants should be treated equally.

Honduras, a source of thousands of immigrants to the United States each year, despite no Cuban-style special treatment, said it was waiting to see if the policy led to fewer Cubans travelling. Mexico’s foreign ministry had no immediate comment.

Manreza said his wife, a nurse, was working in Venezuela as part of a Cuban oil-for-doctors programme. Obama also rolled back a “medical parole” programme dating back to 2006 that allowed Cuban doctors working in third countries to move to the United States simply by walking into a U.S. embassy.

“She cried when I called her,” Manreza said, without saying whether his wife had intended to defect under the programme.

van Diaz, 45, a health administrator said the decision had left him in shock.

“It’s taken the oxygen from me,” he said.

Diaz left Cuba three months ago with his wife. He said the dash for the United States had cost about $25,000 for him, his wife and Miami family members who sent money to support them.

“I’ve got $10 left in my pocket,” he said. “We are going to carry on. We don’t lose anything by going to the Laredo border. We must be able to do something. Otherwise, let them deport me back to Cuba.”

(Additional reporting by Elida Moreno in Panama City, Gustavo Palencia in Honduras and Nelson Renteria in El Salvador; Writing by Frank Jack Daniel; Editing by Clarence Fernandez)