The resignation Thursday of the U.S. special envoy to Haiti in protest of what he called “inhumane” deportations of Haitian migrants spotlighted a widening crisis for the Biden administration, as Democratic allies turned on the White House over images of pursuit and squalor that some lawmakers denounced as racist and immoral.

Daniel Foote’s blistering resignation letter accused the administration of conducting a “deeply flawed” policy of returning Haitian migrants to their home country despite the deteriorating political and humanitarian conditions there.

“I will not be associated with the United States’ inhumane, counterproductive decision to deport thousands of Haitian refugees and illegal immigrants to Haiti, a country where American officials are confined to secure compounds because of the dangers posed by armed gangs in control of daily life,” Foote wrote to Secretary of State Antony Blinken.

The move appeared to catch the Biden administration by surprise, although Foote’s critique echoed the recent outcry from advocates and lawmakers over the treatment of Haitian migrants massed near Del Rio, Tex. White House press secretary Jen Psaki said Foote “had ample opportunity to raise concerns about migration during his tenure. He never once did so.”

In another effort to contain the growing furor, the administration announced it was suspending all horse patrols at the Del Rio migrant camp.

Members of Congress and others have angrily rebuked the Biden administration after images circulated showing U.S. agents on horseback charging at migrants, including family groups, to block their path into the United States.

Rep. Maxine Waters (D-Calif.) said the scene of Haitian migrants being chased down by mounted Border Patrol agents “takes us back hundreds of years.” Waters said the treatment of Haitians, many of them crammed under a bridge in unsanitary conditions, is “worse than what we witnessed in slavery.”

Haiti, the Western Hemisphere’s poorest country, is facing an array of crises, including the proliferation of powerful armed gangs, food insecurity, the spread of the coronavirus and the aftermath of a deadly earthquake in August.

The Biden administration is now preparing to nearly double the number of Haitians being deported to the Caribbean state from Texas, drawing criticism that sending thousands of cash-strapped migrants to the country is unconscionable.

At the same time, officials are releasing many of the Haitian migrants into the United States — and that, too, has attracted criticism, in this case from conservatives and Republicans. The administration has declined to say how many of the migrants are being admitted to the United States.

Foote was named special envoy in July, weeks after the assassination of Haiti’s president plunged the country into political turmoil.

Contradicting Psaki, Foote on Thursday complained that his recommendations had been ignored as the administration refused to adjust or drop its policy, continued from the Trump years, of turning away most would-be asylum seekers under a pandemic-related public health order.

The State Department and White House took issue with Foote’s critique, standing by the practice of shipping most migrants to Haiti rather than allowing them to stay pending a review of their case for asylum. Officials have said it is the Centers for Disease Control and Prevention that decides whether the public health policy should remain in place.

Some liberal critics have begun comparing Biden’s immigration policies to those imposed by President Donald Trump, whose approach to immigration was reviled by Democrats. Administration officials sharply rejected that message, saying any abuse of migrants under Biden is an aberration that is being corrected as quickly as possible, while under Trump it was official policy.

Psaki said Biden’s actions in ordering an investigation triggered by the images and ending horse patrols speak to his own anger at the conditions. The administration hopes to change the deportation policy eventually and explain it more clearly in the interim, she said.

“I think people should take away that it — his actions — make clear how horrible and horrific he thinks these images are, including an investigation, including a change of policy, including conveying clearly that this is not acceptable and he’s not going to stand for this in the Biden-Harris administration,” Psaki said.

Biden has not personally made any significant public comments about the plight of Haitian migrants. But Psaki rejected any Trump comparisons.

“We could not see it as any more different from the policy of the prior administration, which the president feels — we all feel — was inhumane, immoral, ineffective,” Psaki said.

Still, the fact that the administration found itself insisting on its differences from Trump, who made aggressiveness toward immigrants a hallmark of his message, reflected the depth of Biden’s plight.

The president’s handling of the crisis has drawn sharp condemnations from civil rights leaders, including some who have been Biden allies. Unlike the Central American nations from which many migrants arrived earlier this year, Haiti is a majority-Black country.

“Your commitment to racial equity must extend to the treatment of immigrants,” reads a letter sent this week by leaders including NAACP President Derrick Johnson. “As such, we urge you to stop the deportations and immediately grant humanitarian parole to the thousands of Black asylum seekers and process their asylum claims without further delay.”

On Monday, the NAACP went further, tweeting a drawing of a White man apparently about to strike a Black enslaved person alongside a photo of a White Border Patrol agent grabbing a Black migrant. “@Potus if the plan is to #BuildBackBetter step 1 must be tearing down a foundation of oppressive practices,” read the tweet.

Scrambling to respond to such criticism, a trio of White House officials — all Black — met with nine members of the Congressional Black Caucus on Wednesday to talk about the situation in Del Rio.

Rep. Barbara Lee (D-Calif.), who participated in the meeting, said in a telephone interview the conversation was “respectful” and “honest.”

She said both the administration officials and the lawmakers voiced outrage over the images of agents treating Haitian migrants roughly, which she said “takes us back to those dark days of being enslaved and what has happened to Black people in this country.”

Lee declined to say how White House officials responded to her pleas to end deportations.

Some Black leaders are citing the strong Black support for Biden in the 2020 election in their calls for the president to dramatically change his policies.

“Black voters did not risk our lives in order to put President Biden in power only to see him continue the racist immigration and asylum policies of his predecessor,” said Cliff Albright and LaTosha Brown, co-founders of Black Voters Matter, in a joint statement Wednesday.

Homeland Security Secretary Alejandro Mayorkas told reporters Monday the Biden administration intends to empty the Del Rio camp by the end of the month. Officials said about 4,000 migrants remained in the camp Thursday morning, down from a peak of nearly 15,000 on Sept. 18.

More than 1,400 migrants have been returned to Haiti this week, and 3,200 have been transferred to other areas of the border with more capacity to process them, officials said. But asked how many migrants have been released into the United States, the officials said it could take several weeks for that information to be available.

Immigrant advocacy groups there say they are receiving hundreds of individuals daily who are being released from custody and allowed to remain in the United States.

Six flights carrying returnees to Haiti were scheduled for Thursday, according to public information on flight-tracking sites. The flights typically carry 100 to 120 returnees.

DHS officials said that migrants who cannot be expelled to Haiti under Title 42 of the U.S. public health code, the measure triggered by Trump and extended under Biden, would be subject to standard immigration proceedings.

In most cases, that means the migrants seeking asylum or some form of humanitarian protection will be released and issued a notice to appear in court or asked to report to federal immigration officials once they reach their U.S. destination.

Beyond the mass deportations, Foote criticized the administration’s backing of Haiti’s embattled interim prime minister, Ariel Henry, which he said was reminiscent of the “puppeteering” of Haitian politics by the United States and other foreign governments in decades past.

“The hubris that makes us believe we should pick the winner — again — is impressive,” he writes in the letter, which was obtained by The Washington Post. Foote’s resignation was reported earlier by the Center for Economic Policy Research and by PBS.

Many in Haiti believe Henry has been able to hold on to power only because of his backing by the United States. Henry is facing various attempts to oust him, particularly after a prosecutor sought his indictment in connection with the assassination of President Jovenel Moïse.

Henry has denied wrongdoing and described the allegations against him as politically motivated.

Once the migrants are returned to Haiti, the State Department said it is working with the International Organization for Migration “to ensure that returning Haitian migrants are met at the airport and provided with immediate assistance.”

That immediate assistance, IOM officials have said, is largely limited to a one-time $100 cash award, hygiene kits and the availability of on-site medical treatment if needed. There has been no funding available for longer-term assistance, and many deportees are arriving in one of the most dangerous cities in the hemisphere — Port-au-Prince — without transportation or shelter.

State Department spokesman Ned Price suggested that, in resigning, Foote abandoned efforts to find a solution while falsely suggesting that his input had been ignored.

“This is a challenging moment that requires leadership. It is unfortunate that, instead of participating in a solutions-oriented policy process, Special Envoy Foote has both resigned and mischaracterized the circumstances of his resignation,” Price said.

“He failed to take advantage of ample opportunity to raise concerns about migration during his tenure and chose to resign instead.”

Anthony Faiola in Miami contributed to this report.