ON SATURDAY night in Parque Poblado in Medellín, young people gather to drink, smoke and chat. Barbara and her cousin Sophia have more serious business: they hope to make enough money from selling sex to live decently after fleeing Venezuela, where survival is a struggle.

Barbara, who is 27, prefers her former occupation as the owner of a nail and hair business in Caracas, Venezuela’s capital. But polish and shampoo are as hard to find as food and medicine, and so she has come to Medellín. In an hour a sex worker can make the equivalent of a month’s minimum wage in Venezuela. Colombian pesos “are worth something”, unlike Venezuela’s debauched currency, the bolívar, Barbara says. “At least here one can eat breakfast and lunch.”

Some 4,500 Venezuelan prostitutes are thought to be working in Colombia; the trade is legal in both countries. But until recently they were often rounded up by police and deported back to Venezuela by the busload. That changed in April, when Colombia’s constitutional court ruled that Venezuelan sex workers are entitled to work visas. Mass deportations violate international human-rights law, it said. “One should weigh up the reasons they decided to come to Colombia...and the specific situation they would face in Venezuela were they to be returned,” said the ruling.

The case has its origins in Chinácota, a tiny town an hour’s drive from the border city of Cúcuta. Last year the town’s mayor closed down the Taberna Barlovento, a bar that also serves as a brothel, saying it violated zoning rules. Along with beverages, the bar offers four bedrooms just big enough to fit a mattress or two. Founded in 1935, the bar is a Chinácota institution, says Nelcy Esperanza Delgado, its owner.

When the mayor shut Ms Delgado down, she fought back in court. She and the prostitutes who worked there, including four Venezuelans, had no other income, she said. Closing Taberna Barlovento violated their right to work. The court agreed, and the bar reopened.

The ruling is likely to encourage Venezuelans who ply other trades. Daniel Pagés of the Association of Venezuelans in Colombia estimates that 1.5m of his countrymen are in Colombia, about 40% of them without proper papers. The sex workers are joined by electricians, mechanics, empanada vendors—all of whom are seeking a way to cope with their country’s shortages and queues, and an inflation rate expected to exceed 700% this year. Many of them commute daily from Venezuela. They could use the court’s ruling on sex workers to argue that they, too, are entitled to work visas, says Andrés Delgado Gil, the lawyer who argued Ms Delgado’s case.

Colombians along the border are accustomed to Venezuelans streaming across, but the area’s sex workers do not relish the competition. Venezuelans charge the equivalent of $10-13 for a 20-minute session; the Colombian rate is around $13-17. Colombians complain that they are being forced to cut their prices. While Colombia is El Dorado compared with Venezuela, economic growth is slow and the unemployment rate is 9.4%. Colombians haven’t forgotten that in 2015 Venezuela’s president, Nicolás Maduro, blamed them for the shortages and deported 1,100. Many forded rivers on their way back to Colombia.

While the law is becoming more welcoming to desperate Venezuelans, Colombians are growing increasingly nervous about the influx. Barbara thinks other countries offer bigger opportunities. She is planning to move on to Ecuador, where customers pay in American dollars.