The American special envoy to Haiti has resigned in protest at the “inhumane” deportation of hundreds of Haitian migrants back to their country from a camp on the US-Mexican border.

Daniel Foote said that conditions in the Caribbean nation were so bad that US officials were confined to secure compounds because of the danger of armed gangs, and the “collapsed state” could not support the number of returning migrants.

In recent weeks, the poorest nation in the Western Hemisphere has been hit by the assassination of president Jovenel Moise, gang violence and a major earthquake.

Mr Foote claimed the US approach was “flawed” and his resignation follows growing pressure on the Biden administration from fellow Democrats and the UN over the treatment of Haitians in the sprawling impromptu camp near the town of Del Rio, Texas.

Images which showed a US border patrol agent on horseback appearing to use a whip to threaten migrants caused outrage in the White House and from human rights groups.

In both footage and photos, agents were shown confronting migrants near the camp by the Rio Grande river, as they tried to cross the US border from Mexico.

The White House has now said horses will no longer be used by agents at the Del Rio border.

More on Haiti

Jen Psaki, the White House press secretary, has also denied reports that the Department of Homeland Security had issued a new contract to operate a migrant facility at Guantanamo for Haitian migrants.

In recent days, the migrants have been crossing back and forth between the Mexican city of Ciudad Acuna and the camp to buy food and water, currently in short supply on the US side.

As many as 14,000 people were at the camp last Saturday. The population has now been cut to less than half that by expulsion flights and detentions.

On Wednesday, the Department of Homeland Security said the US has returned 1,401 migrants from the camp to Haiti and taken another 3,206 people into custody.

Career diplomat Mr Foote, who became Haiti envoy in July, said in a letter to Secretary of State Antony Blinken: “I will not be associated with the United States’ inhumane, counterproductive decision to deport thousands of Haitian refugees and illegal immigrants.

“Our policy approach to Haiti remains deeply flawed, and my policy recommendations have been ignored and dismissed, when not edited to project a narrative different from my own.”

Analysis by Greg Milam, US correspondent

It is the most damning indictment of all for Joe Biden and his handling of the latest crisis on the border that his own special envoy has resigned with a stinging rebuke for the president.

“Inhumane” and “counterproductive” is how Daniel Foote described the Biden administration’s approach to dealing with the crush of thousands of Haitians in a squalid camp on the border in Texas. Deporting people to a country they left a decade ago, now blighted by poverty and violence, he said was “flawed”.

Foote has been accused by the State Department spokesperson of mischaracterising the affair but the noise of squabbling diplomats hardly helps create an impression of an administration that has a grip.

Senior figures within the president’s own party have expressed alarm at the chaos on the border and the apparent lack of a coherent plan to deal with it or the bigger issue of immigration.

The rush of resources to the International Bridge in Del Rio has thinned the numbers camped there and may give the impression of a problem solved but it has simply shifted that problem elsewhere. It happened with the last border surge crisis in Texas and it will happen again. Where and when the next crush will come is the question.

Biden deputed his vice-president, Kamala Harris, to deal with the border but the issue has rapidly become an enduring crisis of his presidency. Telling people to stay away is not working.

The president himself has been largely silent on the issue. The longer he remains so, the greater the chance for his political rivals to portray him as a man without a plan.

For weeks, Mr Foote had been trying to boost US security assistance to Haiti to pave the way for presidential elections.

But commentators said he became increasingly disappointed with the speed of decision-making in the White House.

A State Department spokesperson said Washington was committed to the long-term wellbeing of Haiti, as well as offering immediate help to returning migrants.