Central American countries have agreed on a "pilot plan" to allow thousands of US-bound Cuban migrants stranded in Costa Rica to continue their journey next month, the Costa Rican Foreign Ministry said on Monday.

"The solution emerging is an absolute exception and only for those people who entered national territory legally," said Foreign Minister Manuel Gonzalez.

Officials meeting in Guatemala City said they would provide flights to an undisclosed number of Cubans to El Salvador, and then provide a bus to Mexico. The officials stressed that the logistics of the plan still needed to be decided upon, but that it would be carried out in "the first week of January."

A Costa Rican Foreign Ministry official said the 8,000 or so migrants would pay for the transportation themselves, while Mexico insisted the plan could yet be revised.

Costa Rica said officials from Panama, El Salvador, Guatemala, Honduras, Mexico and the International Organization for Migration took part in the talks.

Crisis point

Costa Rica stopped issuing transit visas for US-bound Cubans earlier this month after officials said they couldn't provide adequate resources for the migrants. This came after Costa Rica issued almost 8,000 visas to Cubans who crossed the southern border from Panama.

The government warned that any migrants found in the country without the correct paperwork would be deported, and followed through on the threat when they found 56 people who had apparently entered the country illegally on Saturday.

The stranded flow of migrants has been called a humanitarian crisis, with Pope Francis on Sunday urging the region to resolve the "humanitarian drama" in Costa Rica quickly.

The number of migrants flowing to Costa Rica's northern border with Nicaragua has grown steadily, as improved relations between Cuba and the US has prompted thousands from the country to attempt the move to the US. US-bound Cubans fear that Washington could end its preferential asylum rights.

smm/bk (Reuters, AFP, AP)