To cheers from a large crowd of Cuban migrants, Costa Rica on Saturday reopened its border with Panama after a sudden tightening in its immigration policy had left more than 1,200 of them stranded there.

Like other countries in the region, Costa Rica has seen a surge in Cubans entering as the process of detente between Washington and Havana announced in December stirs fears that longstanding asylum rights for Cubans in the U.S. may soon be lost.

Costa Rica surprised the migrants on Friday by detaining them at the border, prompting some Cubans to block the Inter-American Highway for a few hours in protest until the government began issuing them with seven-day transit visas.

It is unclear how the migrants will fare in Costa Rica's other neighbor, Nicaragua, which refused 100 Cubans deported from a holding center in Costa Rica on Friday.

"The situation we're facing is extraordinary – we've never dealt with this before," said Costa Rica's assistant director of immigration, Gladys Jiménez. "We hope Nicaragua will accept them with their documents so they can continue on."

Cuban migrants receive special treatment in the United States from Cold War-era arrangements, and have long traveled through Mexico and Central America to reach the U.S. border. If successful, they can take advantage of the so-called "wet-foot, dry-foot" policy under which Cubans who set foot on U.S. soil can stay, while those captured at sea are sent back.

It is a policy many Cubans feel may be running out of time.

"The situation between the United States and Cuba is an issue because they're talking, and could possibly deny us the support of the Cuban Adjustment Act and the ability to request asylum," said Alain Pentón, 38, a Cuban migrant at the border.

Pentón said he left Cuba on a route taken by many: flying legally to Ecuador, then crossing illegally into Colombia, Panama and Costa Rica. The overland route was safer and less heavily policed than the Straits of Florida, he said.

As of September, 12,166 Cuban migrants had been identified this year by Costa Rican authorities, more than double the figure for last year and over five times the 2013 total.

According to U.S. Customs and Border Patrol data requested by the Pew Research Center, 27,296 Cubans entered the United States in the first nine months of the 2015 fiscal year, a 78 percent increase from 2014.