The acting commissioner of U.S. Customs and Border Protection says he’s stepping down amid outrage over his agency’s treatment of detained migrant children.

John Sanders said in a message to CBP employees Tuesday that he would resign on July 5.

CBP is the agency that apprehends and first detains migrant parents and children crossing the U.S.-Mexico border. Lawyers who visited CBP facilities last week described squalid conditions: inadequate food, lack of medical care, and children trying to care for toddlers.

Six children have died since late last year after being detained by CBP.

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