Carlos Eire is an author and the T.L. Riggs Professor of History and Religious Studies at Yale University.

On Thursday, when President Obama ended the “wet foot, dry foot” policy allowing any Cuban who reached U.S. shores to be granted resident status as a refu­gee, he merely followed his unconditional support of the Raúl Castro regime to its logical end.

The logic is easy to follow: If relations have been normalized between the United States and Cuba, why should those Cubans who arrive here in rafts be treated any differently from other migrants? Why should Cuban doctors working as indentured servants abroad be allowed to claim refugee status when they manage to reach a U.S. Embassy?

After all, if Obama and Castro can enjoy a baseball game together, laugh and do the wave together, can Cuba be really any different from any other normal country?

For all practical purposes, wet foot, dry foot became an anachronism on Dec. 17, 2014, when Obama announced his new Cuba policy. On that day, regarding Cubans as victims of repression became an anachronism, too. For Obama declared to the world that the Castro government was not so different from those of Canada, France or Andorra.

Oh, yes, there was a wee problem with human rights in Cuba, Obama said, but that was inconsequential, because his new policy of friendship with the most brutal dictatorship in the Western hemisphere would change all that, eventually. Castro would come to see the error of his ways once U.S. tourists began flocking to Cuba. Or maybe one of Castro’s successors would be the one to ease up on the repression. The who and when didn’t really matter to Obama. Eventually was good enough for him.

Meanwhile, in Cuba, Obama’s policy created a panic. Many Cubans were smart enough to grasp the twofold significance of Obama’s embrace of the Castro government: First, how this new support from the United States could prolong the life of the Castro regime indefinitely and allow it to rule despotically; and second, how Cubans would no longer continue to be viewed by the United States as an oppressed people.

Those Cubans were right, of course. Since Dec. 17, 2014, repression has increased in Cuba. Secure in the support of the United States, the government has clamped down on freedom of expression, increased arrests and dismantled much of the “cuentapropista” (self-employed) experiment that was supposed to transform and improve the Cuban economy.

Now comes the second repercussion feared by Cubans: Obama strips them of their refugee status just as he heads out the White House door. The Castro government is normal; no more special treatment for Cubans. Cubans are no different from Haitians, or Mexicans or any other migrants. End of story.

Many of those who saw this change coming hurried out in record numbers. The spike in crude vessels full of Cubans intercepted by the U.S. Coast Guard has been huge, as has the increase in those crossing the border through Mexico.

With strokes of his pen, Obama has not only stripped Cuban boat people of their refugee status but also left behind a radioactive stink bomb as a gift for his successor.

Obama’s undoing of wet foot, dry foot could be quickly reversed by President Trump. Like almost every other aspect of Obama’s Cuba policy, this change in the law has taken place through executive order. Congress has been ignored, and so have some laws, especially the Cuban Democracy Act of 1992 (the Torricelli Law) and the Cuban Liberty and Democracy Solidarity Act of 1996 (the Helms-Burton Act).

But consider the traps Obama has set for Trump. If Trump does nothing, he implicitly condones the notion that Cubans are not the victims of a repressive regime. This could anger many of his supporters. If Trump reverses Obama’s policy, he implicitly links the issues of human rights abuses and immigration. If Cubans can be refugees deserving of special protections, why not Syrians? Why is Trump cherry-picking his victims of repression? This could create a firestorm of controversy and anger some of his supporters, too.

Obama has achieved two ends here. First, he has completed the utter betrayal of the Cuban people — a legacy move set in motion two years ago. Second, he has burdened Trump with a no-win situation with the potential to seriously tarnish or weaken his presidency right from the start.

So this parting shot from Obama should come as no surprise. It’s entirely consistent with both his admiration of the Castro regime and his loathing for the tycoon who is taking his place in the Oval Office.