San Jos - Around 200 African migrants, most of them from the Democratic Republic of Congo (DRC), were in limbo between Costa Rica and Panama on Friday, with both Central American nations refusing them entry.
Costa Rica detained them on Thursday when its northern neighbour Nicaragua turned them back at its border as they sought to cross on their way to try to get to the United States.
But Panama, through which they passed to enter Costa Rica, was refusing to accept them back.
The migrants protested on Friday on the Costa Rican side of the border with Panama to be allowed to continue their journey to America.
Costa Rica bolstered that southern border with police after around 1 000 Cubans stuck in Panama and also trying to get to the United States briefly broke through on Wednesday, only to be made to go back.
Costa Rica has issued a statement saying it will not permit the entry of migrants without visas. It criticised countries in South America for allowing them to make it as far north as Central America.
"These migratory flows to Panama and Costa Rica show the inability or bad faith of other southern nations to prevent the entry and transit of irregular migrants," the foreign ministry statement said.
Some of the DRC migrants told AFP they had arrived on the continent in Brazil, where they spent several months or years before heading north through Colombia and Panama with the aim of making it into the United States.
A migration official in Panama, Alfredo Cordoba, told the Panamanian television channel Repretel that the DRC migrants did not have visas so could not be permitted back across the border.
Panama's foreign minister, Isabel De Saint Malo, told AFP in a Twitter message that her government was in contact with Costa Rica's "to ensure the migrants' human rights were being respected".