The surge of desperate young migrants across the southwest border has the Obama administration scrambling to respond. It was clearly ill-prepared for a problem that grew steadily for years before exploding this year, with more than 47,000 unaccompanied children caught at the border since October.

It is past time for excuses, and too soon for the post-mortem. The administration needs to mount a sustained surge of its own, of humanitarian care, shelter and legal assistance for children who have faced horrific traumas in fleeing violence in their home countries, mainly Honduras, Guatemala and El Salvador. As Vice President Joseph Biden Jr. meets this week with officials in those countries, they should all commit to making it safe for would-be migrants to stay home, by reducing the murders and gang crimes that feed the exodus. Congress should meanwhile approve the administration’s $1.4 billion request to handle the emergency on this side of the border, though more will surely be needed to assure health, safety and due process for these young migrants.

The administration’s job has been made harder by an atmosphere of histrionics and wild accusation, as Republican officials, far more interested in blame than solutions, have spent weeks braying about a besieged border and laying the crisis entirely at President Obama’s feet. More justified, and vexing, are the complaints from those witnessing the chaos close-up.

State officials in Arizona were furious that immigration officials, apparently without better ideas, had dumped hundreds of migrants at a bus station in Phoenix, with no resources, to find their way. Civil-liberties groups have reported that children have told of being beaten, harassed, threatened and sexually abused in detention. Some children, interviewed by groups including the American Civil Liberties Union and National Immigrant Justice Center, said they had no food or medical care and had been held in icebox-cold cells — nicknamed hieleras, Spanish for freezers. The administration, which has been racing to set up emergency shelters on military bases in California, Texas and Oklahoma and a converted warehouse in Arizona, needs to investigate and immediately correct conditions that threaten any child’s safety and health.