Every step through the jungle, there is money to be made.

The boat ride to reach the rainforest: $40. A guide on the treacherous route once you start walking: $170. A porter to carry your backpack over the muddy mountains: $100. A plate of chicken and rice after arduous climbing: $10. Special, all-inclusive packages to make the perilous slog faster and more bearable, with tents, boots and other necessities: $500, or more.

Hundreds of thousands of migrants are now pouring through a sliver of jungle known as the Darién Gap, the only land route to the United States from South America, in a record tide that the Biden administration and the Colombian government have vowed to stop.

But the windfall here at the edge of the continent is simply too big to pass up, and the entrepreneurs behind the migrant gold rush are not underground smugglers hiding from the authorities.

They are politicians, prominent businessmen and elected leaders, now sending thousands of migrants toward the United States in plain sight each day — and charging millions of dollars a month for the privilege.

“We have organized everything: the boatmen, the guides, the bag carriers,” said Darwin García, an elected community board member and former town councilman in Acandí, a Colombian municipality at the entrance to the jungle.

The crush of migrants willing to risk everything to make it to the United States is “the best thing that could have happened” to a poor town like his, he said.

Now, Mr. García’s younger brother, Luis Fernando Martínez, the head of a local tourism association, is a leading candidate for mayor of Acandí — defending the migration business as the only profitable industry in a place that “didn’t have a defined economy before.”

The Darién Gap has quickly morphed into one the Western Hemisphere’s most pressing political and humanitarian crises. A trickle only a few years ago has become a flood: More than 360,000 people have already crossed the jungle in 2023, according to the Panamanian government, surpassing last year’s almost unthinkable record of nearly 250,000.

In response, the United States, Colombia and Panama signed an agreement in April to “end the illicit movement of people” through the Darién Gap, a practice that “leads to death and exploitation of vulnerable people for significant profit.”

Today, that profit is greater than ever, with local leaders collecting tens of millions of dollars this year alone from migrants in an enormous people-moving operation — one that international experts say is more sophisticated than anything they have seen.

“This is a beautiful economy,” said Fredy Marín, a former town councilman in the neighboring municipality of Necoclí who manages a boat company that ferries migrants on their way to the United States. He says he transports thousands of people a month, charging them $40 a head.

Mr. Marín is now running for mayor of Necoclí, vowing to preserve the thriving migration industry.

“What was first a problem,” he said of the many migrants who began showing up in the last few years, “has become an opportunity.”

American diplomats have visited the towns next to the Darién Gap in recent months, strolling dusty streets and shaking hands with Mr. Marín, Mr. García and others running the migration business. White House officials say they believe that the Colombian government is following through on its commitment to crack down on illicit migration.

But on the ground, the opposite is happening. The New York Times has spent months here in the Darién Gap and surrounding towns, and the national government has, at best, a marginal presence.

When the national authorities can be seen at all, they are often waving migrants through, or in the case of the national police, fist-bumping the men selling expensive travel packages through the jungle.

The top police official in the region, Col. William Zubieta, said it wasn’t his job to halt the flow. Instead, he argued, the nation’s migration authorities should be exerting control.

“Unfortunately, they do not have it,” he said.

Colombia’s president, Gustavo Petro, acknowledged in an interview that the national government had little control over the region, but added that it was not his goal to stop migration through the Darién anyway — despite the agreement his government signed with the United States.

After all, he argued, the roots of this migration were “the product of poorly taken measures against Latin American peoples,” particularly by the United States, pointing to Washington’s sanctions against Venezuela.

He said he had no intention of sending “horses and whips” to the border to solve a problem that wasn’t of his country’s making.

In the absence of the Colombian government, local leaders have decided to handle migration themselves.

Today, the business is run by elected community board members like Mr. García, through a registered nonprofit started by the board’s president and his family. It’s called the New Light Darién Foundation, and it manages the entire route from Acandí to the border with Panama — setting prices for the journey, collecting fees and running sprawling campsites in the middle of the jungle.

The foundation has hired more than 2,000 local guides and backpack carriers, organized in teams with numbered T-shirts of varying colors — lime green, butter yellow, sky blue — like members of an amateur soccer league.

Migrants pay for tiers of what the foundation calls “services,” including the basic $170 guide and security package to the border. Then a migration “adviser” wraps two paper bracelets around their wrists as proof of payment.

“Like a ticket to Disney,” said Renny Montilla, 25, a construction worker from Venezuela.

Mr. García says that the foundation’s work is legal, in part because it guides people to an international border, but not over one.

Some officials have questioned whether the foundation is running a smuggling operation under the guise of a nonprofit. A human rights officer responsible for monitoring the Necoclí government blamed the crisis on the negligence of national leaders, and noted that officials weren’t motivated to stop it because they were making money from it.

Even Mr. García’s brother, the mayoral candidate, said he wished the national government would clarify the legal “thin line” that local residents working in the migration industry were walking.

“Five hundred thousand people are going to pass through” our town, Mr. Martínez said. “What do we do?”

Hanging over the entire business is a large and powerful drug-trafficking group called the Gaitanist Self-Defense Forces, sometimes known as the Gulf Clan. Its control over this part of northern Colombia is so complete that the country’s ombudsman’s office calls the group the region’s “hegemonic” armed actor.

In a recent report, the ombudsman accused the group of exercising what it called “criminal governance” over the region, meaning that whatever happens here must have the group’s blessing.

Mr. García, the community board member, acknowledged that the armed group “provides security” in the region, but insisted that the foundation was completely separate.

“I am not part of the Gulf Clan,” he said.

In a statement, the armed group contended that it “in no way” profits from “the business that traffics in migrants’ dreams.”

Mr. Petro, the Colombian president, dismissed that notion, saying the Gulf Clan was earning $30 million a year from the migration business.

At the edge of the forest, the transactions are plain to see.

Before they enter the jungle, migrants have to pay the group a separate tax of about $80 a person for permission to cross the Darién, according to multiple people who collect the fee in Necoclí.

Once migrants have paid, they even get a receipt, the tax collectors say: a tiny sticker, often an American flag, on their passports.

Thick, hot and prone to intense rain, sliced by raging rivers and steep mountains, the Darién jungle acted as a vast natural barrier between North and South America for generations, thwarting the flow of people north.

Guerrillas and other armed groups have long used the dense forest for cover and drug smuggling, sometimes attacking those who dared to pass. The terrain and threat of violence once kept all but the most desperate away.

But a stew of crises and politics — like the turmoil in Venezuela, Haiti and now Ecuador, the economic devastation of the pandemic, and visa regulations that prevent many migrants from simply flying to Mexico or other countries — has brought a huge rise in the number of people trekking from South America to the United States in the last few years.

Now, the New Light Darién Foundation is helping to turn that natural barrier into something much more passable, with restaurants, camps, porters and guides.

This new economy, run in large part by elected leaders, has acted as an accelerant, emboldening more people to take — and pay for — the journey than ever.

In August alone, almost 82,000 people made the trek through the Darién, according to Panamanian officials, by far the largest single-month total on record.

So many people are coming through the jungle that Panama and Costa Rica say they cannot handle the surge. Panama’s top migration official, Samira Gozaine, has even threatened to close its border with Colombia.

And the political tumult stacks up all the way to the United States. After dipping briefly this year, migrant apprehensions at the American border have risen again, with a record number of families crossing.

The Colombians transporting migrants through the jungle say they are providing a humanitarian service. The migrants will try to get to the United States regardless, they say, driven by violence, poverty and political upheaval at home.

So, by professionalizing the migration business, Colombian leaders say they can prevent their impoverished towns from being overwhelmed by hundreds of thousands of needy people, help the migrants traverse the treacherous jungle more safely — and feed their own economies in the process.

Migrant deaths in the Colombian portion of the Darién now appear to be relatively low, aid workers say, because even the Gaitanist armed group, or Gulf Clan, has realized that the Darién’s notoriety is bad for business. Local officials say the group has set a policy to keep customers coming: Anyone who robs, rapes or kills a migrant will face punishment, possibly even death.

But the Daríen is still perilous, with diseases like malaria and dengue stalking migrants in “a grotesque test of survival,” said Carlos Franco-Paredes, a doctor studying the journey.

Beyond that, the foundation’s guides take migrants only part of the way, leaving them at the border with Panama, often with no food or money left — and days of hiking to go in a part of the jungle that is even more dangerous than what they already endured. The United Nations counted more than 140 migrants deaths in the Panama portion of the Darién last year alone, nearly triple the year before. At least 10 percent of them were children.

Mr. Petro, Colombia’s first leftist president, came to office last year promising to help long forgotten parts of the country — like the communities now in charge of the jungle crossings.

In the interview, Mr. Petro said he had never heard of the New Light Darién Foundation. But just like the people running the migration business, he presented his hands-off approach to migration as a humanitarian one.

The answer to this crisis, he said, was not to go “chasing migrants” at the border or to force them into “concentration camps” that blocked them from trying to reach the United States.

“I would say yes, I’ll help, but not like you think,” Mr. Petro said of the agreement with the Biden administration, which was big on ambition but thin on details. He said any solution to the issue had to focus on “solving migrants’ social problems, which do not come from Colombia.”

He expects half a million people to cross the Darién this year, he said, and then a million next year.

On the other side of the Darién Gap, Panamanian officials are fuming, accusing “countries to the south” of shirking “their due responsibility” to stem the tide of people heading north.

“There is nothing humanitarian about this,” Ms. Gozaine, the Panamanian migration official, said at a recent news conference. “The children who die in the jungle, the women who are raped, the men who are raped, the people who are killed.”

The boats leave each day from the eastern edge of Necoclí, the docks filled with people from around the world — not only from the Western Hemisphere, but from as far as India, China and Afghanistan.

“Travel safe!” Mr. Marín’s employees boom from a microphone. “Travel happy!”

At his office, where a service award from the national police hangs on the wall, Mr. Marín said that he was proud to be a part of the industry that had become the region’s most important employer.

Just outside, a new construction project soars, soon to be a gas station that will fuel his boats more quickly than ever.

Remote, tropical and bordering the Caribbean Sea, the Colombian towns on the migrant path to the jungle are beautiful but poor. More than half of their residents live below the poverty line. Many are victims of the country’s decades-long war, forced to live among criminal groups for generations. Fishing, tourism and wildcat gold mining have long been among the main sources of income.

But in 2021, the towns started changing, quickly. Thousands of Haitians began showing up, fleeing the tumult that only worsened after the assassination of their president.

Suddenly, the region’s already precarious sewage, water and electricity systems were overwhelmed. The beaches filled with migrant tents, pushing out an already struggling tourism industry.

The way local leaders tell it, pleas for help from the national government fell on deaf ears.

Mr. Marín, then a city councilman, was one of the first to do something big, turning crisis into opportunity by taking command of the boat company, Katamaranes S.A.S., with the goal of shuttling migrants to the Darién on their way to the United States.

Since then, Necoclí, once a sleepy beach town offering two-for-one cocktails, nature hikes and sea excursions for tourists, has been transformed.

At almost any hour, day or night, private buses wheeze into town, carrying migrants who have learned about the Darién route on Facebook, WhatsApp and TikTok, the de facto advertising services for the journey.

The streets of Necoclí are now filled with people speaking Mandarin, Persian and Nepali. Locals with wooden carts make a living selling flimsy tents, snake repellent and toddler-size rubber boots. Aid workers in canvas vests patrol the streets, offering a bit of help — water jugs, diapers, sunscreen.

A laminated instruction booklet tied to the register at a grocery store provides tips for crossing the jungle. A map marks in red the common locations of “violent assaults and rapes.”

New hostels are everywhere. In a region so poor that horse carts still plod the streets, expensive motorcycles roar through town and $100,000 SUVs roll alongside the sea.

The poorest migrants arrive by foot, camping on the beach. Most come from Venezuela, which has been in the grips of an economic and humanitarian crisis for nearly a decade, with few signs that the country’s authoritarian leader, Nicolás Maduro, will give up power any time soon.

Many of the Venezuelan migrants congregate outside a thatch-roof soup kitchen opened just a few months ago by an aid group. Here, children waiting for meals of beans and arepas bear the telltale signs of malnutrition: skinny limbs, hair turned rust yellow.

Francis Sifontes, 32, stood in the breakfast line. In Venezuela, she had made so little working for the government’s signature food-distribution program that her husband had been forced to beg in the street.

Destitute, the family moved to Colombia, where they cut sugar cane, grueling work that paid $5 a day.

Ms. Sifontes had arrived in Necoclí three weeks before, with her husband, stepson and four young children. To earn money for the rest of the journey, they had found work in the region’s new micro-economy, buying small goods in bulk from local merchants — plastic trash bags, cheap lighters — and selling them to other migrants for a profit of 20 or 30 cents a piece.

At night they slept in a single tent in the shadow of Mr. Marín’s office.

But they were hopeful, Ms. Sifontes said, because they had recently struck a deal with Mr. Marín. If they cleaned the beach by his business, for an unspecified amount of time, she said, Mr. Marín had promised to give them three boat tickets to the Darién.

Once across the choppy Gulf of Urabá, the passengers on Mr. Marín’s boats arrive in the town of Acandí, at the mouth of the jungle. For decades, some residents here have led migrants into the jungle for a fee, arguing that people would die without help.

But with the arrival of the Haitians in 2021, and then an even bigger wave of Venezuelans in 2022, local leaders began to organize, bringing the migration business under the New Light Darién Foundation.

On a recent afternoon, Alexandra Vilcacundo, 44, traveling with 30 others fleeing the rising violence in Ecuador, stepped onto the wooden dock in Acandí. Ms. Vilcacundo, a seamstress, looked terrified, having left three children behind. “We know that we are risking our lives,” she said of the journey ahead.

On the bus to Necoclí, she said they had been stopped five times by Colombian police officers who threatened to arrest them unless they paid bribes. (A dozen others said they had also been extorted by the police.)

Once loaded into motorized rickshaws, Ms. Vilcacundo and the other migrants were ferried through Acandí on dirt roads still flooded from the previous night’s rain. They passed cow pastures and a corn field, before finally passing through a gate into a compound Mr. García called “the shelter.”

There were no police, migration authorities or international groups present. To the contrary, an insignia — “AGC,” the Spanish initials of the Gaitanist Self-Defense Forces, or Gulf Clan — had been painted on a wall on the way to the shelter, a reminder of who ultimately called the shots.

Roughly a thousand migrants had gathered inside the compound. Local men in skinny jeans, polo shirts and sunglasses roved the sun-beaten expanse, introducing themselves as the foundation’s “advisers,” in charge of collecting fees and describing the route from here.

For those who didn’t have the money on hand, there was a Western Union agent inside the compound, charging 15 percent per transfer.

Mr. García of the community board showed off public works nearby, built by the board with funds from the migration business, he said: a foot bridge by the dock, a school in one of the area’s poorest neighborhoods, meters of paved road, a drainage system so the town would not flood.

He said the town had spent decades trying to become a tourist destination. But for now, without decent schools, a hospital or even a road connecting it to the rest of the country, all it had was migration.

“What we have done” with migration is more than tourism brought “in 50 years,” Mr. García said.

Few places embody the transformation of the Darién route like the first camp in the jungle.

Two years ago, the route from the shelter in Acandí to this camp, Las Tecas, was a crude dirt path. Today, it is a road navigable by truck. The camp itself was once a muddy expanse. Today it is a village, with a welcome pavilion, security checkpoint, 38 shops and restaurants, Wi-Fi and even a billiard hall.

Here, the New Light Darién Foundation has organized the vast teams of guides and backpack carriers in their numbered and color-coded T-shirts. A few have dressed up their uniforms further, adding words like “respect” and “friendship” to their sleeves.

The foundation coordinates their schedules to spread around the work — guides get to make one trek every 15 days — and pays them $125 per trek. Porters are contracted individually by migrants who want help carrying their luggage or children, somewhere between $60 and $120 per load. Any employees who abandon or rob their charges are fired, said Mr. García.

“If I had not found this job, I have no idea how I would have sustained my family,” said Aureliana Domicó, 32, a single mother who works as a backpack carrier, carting up to 70 pounds to the Panama border several times a week. Months ago, a heavy rain wiped out her plantain crop, leaving her four children with nothing to eat. Now, she makes as much as $800 a month.

Elmer Arias, 29, a guide, had struggled to find work after losing an arm. He had punched a window in anger, and because there is no hospital in Acandí, it took him days to get care, eventually leading to an amputation. The migrants were not that different from him, he explained — reaching for better lives, “just like us.”

At the Las Tecas welcome pavilion that evening, guides wanded the migrants with metal detectors, a new protocol.

“Razors?” one guide asked, confiscating anything sharp. “Knives? Machetes?”

The next morning, more than 2,000 migrants assembled in the heart of the camp. There were children in Barbie T-shirts, two anxious moms with toddlers on leashes, a man with a baby on his back and a doll tucked into his waistband, a woman with an American flag backpack.

Samuel, 13, wore a purple Lakers shirt. His mother, an elder care aide, had left Venezuela years before, moving from city to city in Colombia and Peru, trying to find decent work. She had spent the last of her savings on their tickets to the jungle.

To their right, the sun rose over the forest. To their left, guides and backpack carriers waited. The crowd buzzed with excitement.

Soon, a man from the foundation, Iván Díaz, climbed a hill above the camp, beginning the morning’s orientation. This was not a race, he instructed on a megaphone. This was about surviving to make it to the United States.

Don’t sleep by the rivers, he said; they often rise with the rain. Eat food with salt to prevent dehydration. Take breaks. Children should stay with their parents. Pregnant women should stick with the guides. Anyone caught with drugs would get sent back to Necoclí.

A bullhorn roared. “Applause!” Mr. Díaz shouted. The crowd cheered.

“Duro, duro, duro,” he yelled — hard, hard, hard — “for Maduro, Maduro, Maduro!” he added, a sarcastic nod to the Venezuelan president.

The group laughed and booed.

“With God’s blessing it will all go well,” Mr. Díaz continued. “I know that in three weeks you will be sending me Western Union transfers from New York.”

It was roughly a day and a half hike to the border with Panama, and along the way, the foundation had positioned small camps where migrants could buy water and food.

Prices rose as people climbed. A Gatorade cost $2.50 at the start, and $5 at the end. Ice cream sellers hiked with the crowd, coolers on their backs. At the bend of a river, the crowds were met by a man holding a platter of homemade empanadas for sale.

The migrants moved slowly, crisscrossing a river, climbing hills knotted by roots. With so many people, the traffic jam at times slowed to gridlock.

By midmorning, Natasha, 5, from Ecuador, slipped from the shoulders of a man who had been carrying her. Natasha came crashing down, slicing a spot above her eye on a rock.

She wailed in pain as blood gushed from her face. Her mother began to panic.

But up ahead, there was a nurse. In recent months, the New Light Darién Foundation has hired several nurses and a doctor to care for the migrants. In the absence of any other institutional presence, they had become a lifeline.

On the porch of a hut, the nurse, José Luis Fernández, cleaned the wound, injected an anesthetic and sutured the cut. “If it had hit a little higher,” he said of the blow, “we could have been talking about a dead person.”

Mr. Fernández used to work for a public hospital in nearby Turbo, he said, but left “for salary reasons.”

The foundation pays him much more.

Most of the group slept that night in a crowded, muddy expanse known to the guides as the Fourth Camp, where a generator buzzed and several restaurants offered fried fish or chicken for $10 a plate, a small fortune for most of the migrants.

Many families, having spent all their money to get this far, ate nothing, wondering what they would do for the rest of the trek. At dusk, the camp smelled of human feces and gasoline. The mood began to shift.

In his tent, José García, 32, explained that he had already crossed the Darién last year, but had decided to turn around after it seemed the Biden administration would not let Venezuelans into the United States.

Now, he was trying again, this time with his wife, Dayarid Pernia, 24, and their two children, ages 1 and 3. But by this point, they were penniless.

He rued the prices charged by the foundation to get this far.

“If this were humanitarian,” Mr. García said of the route, his voice settling somewhere between a laugh and a cry, “they would lend a hand to those who have nothing.”

For thousands of migrants, the normalization of this route has set up a cruel paradox.

On the Colombian side of the Darién, where the government is almost absent and the Gaitanist Self-Defense Forces, or Gulf Clan, dominate, crime in the jungle is lower, at least according to aid groups and researchers interviewing migrants at the end of the route.

That perception of safety is sending more and more people into the forest, believing that they will make it out alive.

But at the border with Panama, the foundation’s guides leave them — crossing could lead to arrest — and the power of the armed group recedes. Then, on the Panamanian side, small criminal bands rove the forest, using rape as a tool to extract money and punish those who cannot pay.

The regional head of one aid group said that women and children are often the victims, with men forced to watch. Children as young as 6 have been shot and killed in this section of the jungle in the past year.

And anyone without money — including those who spent it paying guides in Colombia — is particularly vulnerable.

On their last morning in Colombia, the group of more than 2,000 migrants rose before dawn. Inside one of the restaurants, a few raised their hands in a pre-trek prayer.

“Thank you, Lord,” said Nestor Fernández, 33, a Venezuelan who had been working construction in Chile. “Just as we submit to you, may everything that tries to rise against us submit — every robbery, every theft, every kidnapping, every killing.”

In the darkness, the parade of people began their march to the border. Children held jugs of sugar water, which might be their only sustenance for days. A pregnant woman was helped out of the camp by two others, one on each side.

It took roughly two hours to climb two hills known as the Twins, and then they reached a muddy clearing with a hand-painted sign marking the border.

In the clearing, migrants still lucky enough to have money paid their porters. And then a man — one of the guides had introduced him as the “head of security,” without elaboration — stepped forward to offer final instructions.

Move slowly, stick together and follow a route marked by blue and green pieces of plastic, he told the group. It would take three more days to reach the end of the jungle, he explained, where the United Nations and the government of Panama offered support.

“From the municipality of Acandí,” he said before the migrants pushed on, “we would like to wish you a happy trip.”

Reporting was contributed by Federico Rios in the Darién Gap and Simón Posada in Bogotá.