Authorities in Costa Rica say they will issue special seven-day transit visas to 1,600 Cuban migrants who have been detained in recent days after crossing over from Panama.

Following the thaw in relations between Washington and Havana, some Cubans have been making their way to Central America in hopes of then heading north across Mexico and over the border into the United States.

Costa Rica's government initially was just deporting Cubans who arrived without proper visas, but criminal gangs began using the deportation process to facilitate the illegal transportation of migrants to the U.S. So the government halted the process, and Cuban migrants began to fill up detention centers.

On Friday, immigration chief Kattia Rodriguez said Cubans are being given the temporary visas and are being accepted into neighboring Nicaragua.