MIAMI — The United States government has been paying to feed and shelter thousands of Cubans trying to migrate to the United States, in what critics consider another sign of the lopsided treatment provided to Cubans under American law.

The Obama administration has tried hard to deter the crush of migrants arriving from Central America in recent years. It has pressed Mexico to crack down on migrants passing through its territory, while women and children who managed to cross the American border have been held in detention facilities.

But American law gives Cubans special status to live in the United States and apply for a green card, provided they make it here. That has set off a rush of Cubans who have taken advantage of changes inside Cuba that make it easier to leave, and who are worried that the Obama administration’s improved relations with their government will soon erase their privileged status.

In January, the United States pledged $1 million to help provide temporary shelter, potable water, food, sanitation and hygiene kits to thousands of Cubans who were stranded in Costa Rica while trying to make their way to the American border.