Mexico said it planned to grant temporary, 20-day transit visas to 180 Cubans stuck in Costa Rica en route to the United States, Reuters reported Wednesday. The Cuban migrants were chosen out of thousands stranded in Costa Rica.

The National Migration Institute said Cubans will not be permitted to stay after the expiration of the temporary visas, which were given for humanitarian reasons, Reuters reported. The migrants' arrival marks the start of pilot program agreed upon last month that would allow the migrants to move toward the U.S. from Costa Rica where they had been stuck since mid-November after Nicaragua shut its borders. The first group of 180, chosen out of an estimated 8,000 migrants stranded in Costa Rica, flew to El Salvador Tuesday and rode in buses to Mexico Wednesday.

The flow of Cuban migrants headed to the U.S. has surged as the two nations have begun normalizing relations, amid fears of an end to the U.S. policy of automatically granting residency to Cubans who come to the country.

Costa Rican Foreign Minister Manuel Gonzalez said Wednesday Central American governments would meet next Thursday to evaluate the first trip of migrants and to decide if the program should continue, Reuters reported. The Mexican government has said diplomats are expected to work out how to pay for the migrants' travel. The cost of the trip for each passenger was $555, which paid for airfare, exit taxes, ground transportation and food along the way, La Nacion reported, via teleSUR.

Traveling across land toward the U.S. has become the more common route for Cuban migrants. It is a 7,000-mile trip from Ecuador up through Mexico. But some still attempt to get to the U.S. by sea. The Mexican navy last week rescued nine Cubans drifting on a makeshift boat in the Caribbean.