Cuba says it will allow the U.S. to repatriate 38 migrants stuck aboard a Coast Guard vessel.

U.S. authorities detained the migrants at sea as they headed toward the United States. Those migrants would ordinarily be quickly sent back to Cuba under an existing agreement intended to discourage sea crossings. But U.S. officials said Cuba balked because the migrants had tourist visas issued by the Caribbean nation of St. Lucia and thus were not covered by the agreement.

Cuba now says it was only analyzing the situation. The government said Saturday it will make an exception and allow the repatriation.

Cubans who make it to the U.S. can qualify for residency, which has prompted many to travel to third countries in hopes of finding another way to reach the U.S.