BOGOTA, Colombia — José Sanbrano stopped on a roadside in the Colombian capital to catch his breath. The 30-year-old migrant had been walking for 15 days. He had hundreds of miles more to go — uphill, through the Andes — before he would reach the broken homeland he once fled.

Venezuela.

Nearly 5 million Venezuelans have abandoned the collapsing socialist state in recent years, most of them to scrape out meager livings elsewhere in Latin America. But as countries from Argentina to Peru to Colombia shut down to slow the spread of the coronavirus, untold thousands of desperate Venezuelans, now jobless, hungry and living without a safety net, are heading home.

For a growing number, the decision has been agonizing. Sanbrano was working on a construction site in Quito, Ecuador, and sending back money for his young wife and infant son. When Ecuadoran President Lenín Moreno ordered a national lockdown, he quickly lost his job. Unable to pay the $60 monthly rent for his small room in the capital, and with no hope of finding new work, he was evicted.

Faced with the choice of hunger and homelessness in Quito or the compounding but familiar hardships in Venezuela, he opted to travel back to his family. He packed his few belongings and set out on the 1,590-mile trek back to Caracas.

“I’ve been sleeping and eating on the streets along the way,” Sanbrano said. “I’ve had to beg for food. It shames me that I have to do that.”

Venezuelan President Nicolás Maduro is seeking to portray himself as a benevolent father figure to his returning prodigal sons and daughters, even as his authoritarian government struggles to cope with their numbers in a country uniquely ill-prepared to respond to a pandemic.

“We’re looking out for our compatriots who are victims of xenophobia & have decided to return to [Venezuela], their homeland,” Maduro boasted on Twitter. “Here we’ve our arms opened to them as we have done with millions of people who have found in our country a land of peace & hope. Welcome!”

Maduro said 15,000 Venezuelans were on their way home. Internal numbers being shared by officials in Venezuela’s border region of Tachira state show at least 7,600 have arrived since mid-March. More are arriving at a rate of up to 500 per day.

Those numbers remain relatively small compared with the massive recent outflow of Venezuelans, which until the virus arrived was still running at 4,000 to 5,000 a day. But observers warn they could rapidly grow, further burdening Venezuelan hospitals already plagued by shortages of medicines, supplies, power and water.

Lockdowns and closed borders across Latin America, meanwhile, are likely to sharply curb the outflow in 2020. Neighboring Colombia, home to an estimated 1.8 million Venezuelan migrants, closed its border with the country last month. But it has kept open a humanitarian corridor to allow Venezuelans to return home.

Marianne Menjivar, Colombia and Venezuela director for the International Rescue Committee, said Venezuelans have nowhere to turn.

“If you’re a migrant or refugee, you don’t have an auntie you can go get some soup from in case you don’t have any money, or a grandmother who will lend you some money so you don’t get kicked out of your house,” she said.

Returning migrants are required to obtain medical checkups both before and after crossing the border, leading to hours, even days-long delays. That’s prompted some to turn to dangerous informal crossings, known locally as trochas, manned by armed groups.

Felipe Muñoz, Colombia’s presidential adviser on the migration crisis, said at least 1,000 Venezuelans arrived by bus in the border city of Cúcuta over the weekend with the intention of returning.

The operation is complicated by the strained relations between the two countries. Colombian President Iván Duque has expressed support for Venezuelan migrants in his country. But his government recognizes Venezuelan opposition leader Juan Guaidó, not Maduro, as the country’s rightful leader, and each government accuses the other of using armed groups to undermine its rule.

“We’ve had to negotiate with the other side, so they accept them little by little,” Muñoz said. “But that’s not something we want to be promoting, because we don’t want to have uncoordinated migration flows in the middle of a health emergency.”

On the Venezuelan side, at least some returnees are finding themselves herded immediately into quarantine. Freddy Bernal, designated by Maduro as the “protector of Táchira,” tweeted Sunday that the region was activating a containment plan based on the recommendations of the World Health Organization. Venezuelan officials elsewhere said they were preparing holding centers for returnees.

Yohana Briceño, 36, returned to Venezuela with her family of five Saturday. They had no coronavirus symptoms, she said, but were still being held in a facility near the border. They were sleeping on a concrete floor and sharing “filthy bathrooms” with 900 other returnees, she said by telephone. They haven’t been told how long they will be held.

“As soon as we crossed the border, everything changed,” she said.

With commerce shut down and unemployment soaring, some countries are eager to see their Venezuelan migrants gone. Bogota Mayor Claudia López said last week the city would not extend the rent assistance now offered to struggling Colombians to Venezuelan migrants.

“We already pay for food, child care, school,” she said. “Sorry, but we can’t cover rent.”

Several Colombian mayors have organized buses to send migrants to the border.

On a recent afternoon, at least 60 Venezuelan migrants were passing through Bogota on foot en route to Cúcuta, some 342 miles east. They pushed strollers, shopping carts and suitcases loaded with their belongings.

Some were able to pay the $30 bus fare to the border. Those who couldn’t planned to walk.

Yessika Silva came to Bogota from Caracas three years ago with her three daughters. On a recent afternoon, they desperately tried to hitchhike, with no luck.

“I haven’t been able to earn anything for weeks,” said Silva, 36. Her daughters, she said, are exhausted: “Their legs are throbbing.”

Briceño, still being held with her family, said they had struggled to build a new life in Colombia. She found work as a hairdresser; her husband did construction. But when the virus came, they lost their jobs.

“I had a dream of staying there,” she said. “We could have had a future.

“Now we are stuck [in Venezuela] with only God to help us.”

Faiola reported from Miami. Herrero reported from Caracas, Venezuela. Mariana Zúñiga in Caracas contributed to this report.