By Oswaldo Rivas

PENAS BLANCAS, Nicaragua (Reuters) - Nicaragua on Sunday closed its border with Costa Rica to hundreds of Cubans headed for the United States, stoking diplomatic tensions over a growing wave of migrants making the journey north from the Communist-ruled island.

Nicaragua's government accused Costa Rica of sparking a "humanitarian crisis" after its southern neighbor issued transit visas over the weekend to more than 1,000 Cubans who had been detained at its border with Panama demanding the right to proceed.

Central America and Mexico have registered a surge in migrants from the island as the process of detente between Washington and Havana announced in December stirs fears that long-standing U.S. asylum rights for Cubans may soon end.

Led by former Marxist guerrilla Daniel Ortega, Nicaragua is a close ally of Cuba, and his administration complained that Costa Rica's actions had violated its national sovereignty.

"The Nicaraguan government calls on the international organizations responsible to deal urgently with this complaint," Rosario Murillo, government spokeswoman and first lady of Nicaragua, said in a statement.

The Costa Rican government had no immediate comment.

Under arrangements stemming from the Cold War era, Cuban migrants receive special treatment on reaching the United States. According to the "wet-foot, dry-foot" policy, Cubans who set foot on U.S. soil can stay, while those captured at sea are sent back.

Earlier on Sunday, Nicaraguan security forces turned back hundreds of Cubans who they say had crossed into the country illegally. The security forces later stood guard as migrants looked on in the hope they could soon progress.

"We don't want to stay in any of these countries, our aim is to reach the United States, that's our objective," said 33-year-old Alexei Cabezas, adding he left Cuba nearly a month ago and was also held up at the Costa Rica-Panama border.

Another migrant calling himself Damian estimated there were about 2,000 Cubans on the Costa Rican side of the border with Nicaragua.

"Here we are waiting to be granted the safe-conduct that Nicaragua always gives to Cubans. But, well, today's Sunday, and we don't know if they're going to work today or not," said 30-year-old Maria del Carmen Garcia, another migrant.

(Writing by Dave Graham; Editing by Peter Cooney)