President Barack Obama is ending a longstanding immigration policy that allows any Cuban who makes it to U.S. soil to stay and become a legal resident, a senior administration official said Thursday.

The repeal of the “wet foot, dry foot” policy is effective immediately, according the official. The decision follows months of negotiations focused in part on getting Cuba to agree to take back people who had arrived in the U.S.