The head of the Customs and Border Protection agency is leaving, and his replacement probably won't warm the hearts of advocates for immigrants.

John Sanders, the acting CBP commissioner, resigned Tuesday amid reports of migrant children at the border being held in unsafe and filthy conditions.

His resignation comes as public furor has increased over the treatment of detained migrant kids after lawyers reported some of the older children were caring for toddlers at a facility in Clint, Texas, and they lacked adequate food, water and sanitation.

Sanders is expected to be replaced by Mark Morgan, a former Marine and FBI agent who has been leading Immigration and Customs Enforcement (ICE) for fewer than two months, according to a senior administration official who spoke on condition of anonymity because the decision has not been finalized.

Morgan served as chief of the Border Patrol in the final months of the Obama administration, but he has since become a vocal supporter of President Donald Trump’s hard-line immigration-enforcement strategy.

He defended the president’s controversial decision to declare a national emergency to get funding to expand the southern border wall. “The president had no choice,” Morgan said during a February interview on CNN.

When announcing Morgan's appointment to head ICE on May 5, Trump called him “a true believer and American Patriot.”

And just last week, Morgan vowed to enforce Trump’s plan, which has since been delayed, to ramp up arrests and deportations of families that have entered the country and had their asylum requests denied.

“If you come here with a child, that’s a passport in the United States,” Morgan said on the PBS NewsHour. “Nothing happens to you. That’s a slippery slope, and no integrity in the system, and the rule of law is being eroded if we don’t apply consequences.”

Carla Provost, the head of U.S. Border Patrol, a component of CBP, was touring the border in Yuma, Arizona, on Tuesday when she learned of Sanders’ resignation. The incoming head of CBP will be Provost’s third boss since she took over the agency and its 19,500 agents in April of 2017.

Provost said the turnover at the top of CBP, and a broader leadership shakeup at the Department of Homeland Security, has not affected the work of Border Patrol agents as they deal with the ongoing surge of migrants crossing the southern border.

“I don’t see that as having an impact on our ability to do our jobs and fulfill our mission,” she said. “We have had support no matter what when it comes to the mission, when it comes to the crisis at hand in relation to the leadership.”

Raids on hold:Trump delays nationwide ICE raids to deport undocumented immigrants, allows Congress two weeks on deal

Morgan faces a stiff challenge as conditions on the southern border with Mexico have reached a crisis point with a surge of Central American migrants seeking asylum.

Sanders, who has overseen the agency responsible for border enforcement since April, said in a letter to employees that his resignation is effective July 5.

"Although I will leave it to you to determine whether I was successful, I can unequivocally say that helping support the amazing men and women of CBP has been the most fulfilling and satisfying opportunity of my career," Sanders wrote.

Trump said Tuesday at the White House that he did not ask Sanders to resign but was “very concerned” about conditions at migrant detainee facilities. He criticized Democrats for holding up funding for humanitarian aid on the border even as House leaders worked on getting that funding approved.

After threatening mass raids by ICE last week, Trump called them off and gave Congress two weeks to find a solution to the border crisis.

An official from CBP said Tuesday that the agency moved more than 100 children back to the Clint facility. The official said the “majority” of the roughly 300 children detained there last week have been placed in facilities operated by the Office of Refugee Resettlement.

The official, who briefed reporters on the condition of anonymity, said Clint is better equipped than some of the Border Patrol’s tents to hold children.

Six children have died since late last year after being detained by CBP, the agency that apprehends and first detains migrant parents and children crossing the U.S.-Mexican border illegally.

On Tuesday, CBP issued a statement that said in part: "CBP continues to utilize all available resources to prioritize and care for children in our custody and facilitate their expeditious transfer to HHS (Department of Health and Human Services) custody.''

Sanders pushed Congress to pass $4.5 billion in humanitarian funding. In an interview last week with The Associated Press, he talked about how the deaths impacted him "profoundly.”

Sanders moved up from CBP's chief operating officer to acting commissioner when Kevin McAleenan left the position to replace Kirstjen Nielsen as secretary of the Department of Homeland Security, also in an acting capacity.

"I will never stop defending the people and the mission for which 427 people gave their lives in the line of duty in defending,'' Sanders told employees in the letter. "Hold your heads high with the honor and distinction that you so richly deserve.''

The pressure on CBP increased when the lawyers who visited facilities last week described squalid conditions to The Associated Press, such as lack of medical care and several children afflicted with the flu.

Rep. Bennie Thompson, D-Miss., chairman of the Committee on Homeland Security, said Sanders' resignation “adds fuel to the chaos at the Department of Homeland Security."

"CBP is clearly failing to carry out its mission, given the Trump administration’s disastrous immigration policies," he said. "It is quite clear that bad actors in the White House are doing all they can to strong-arm the Department of Homeland Security and stand in the way of any progress or agreeable solution. There is simply no excuse for the horrific conditions children and families are being held in at the border.''

The chairman of the Senate Judiciary Committee, Sen. Lindsey Graham, R-S.C., said he didn’t know why Sanders resigned, but that a new CBP director would be needed every few months if conditions along the border don’t improve.

"Money will help,'' Graham said. "But if you don’t stop the reason they’re coming from Central America, you better get ready to do this every three or four months. To my House colleagues, making conditions better at the border: great. But you’ve got to stop the pull factors. If there’s no change in the pull factors, it’s just throwing good money after bad.”

Contributing: John Fritze, Bart Jansen, USA TODAY; The Associated Press