Once nearly impenetrable for migrants heading north from Latin America, the jungle between Colombia and Panama this year became a speedy but still treacherous highway for hundreds of thousands of people from around the world.

Driven by economic crises, government repression and violence, migrants from China to Haiti decided to risk three days of deep mud, rushing rivers and bandits. Enterprising locals offered guides and porters, set up campsites and sold supplies to migrants, using color-coded wristbands to track who had paid for what.

Enabled by social media and Colombian organized crime, more than 506,000 migrants — nearly two-thirds Venezuelans — had crossed the Darien jungle by mid-December, double the 248,000 who set a record the previous year. Before last year, the record was barely 30,000 in 2016.

Dana Graber Ladek, the Mexico chief for the United Nation’s International Organization for Migration, said migration flows through the region this year were “historic numbers that we have never seen.”