The Defense Department will house up to 20,000 unaccompanied migrant children on military bases in coming months, a Pentagon official said Thursday, the latest twist in the Trump administration’s immigration enforcement effort.

The agreement comes after the Department of Health and Human Services made the request. Army Lt. Col. Jamie Davis, a military spokesman, said Thursday that the Pentagon will support it.

In a notification to lawmakers, the Pentagon said Wednesday night that officials at HHS asked whether beds could be provided for children at military installations “for occupancy as early as July through December 31, 2018.”

The plan seemingly will have similarities to 2014, when the Obama administration housed about 7,000 unaccompanied children on three military bases. As required under the Economy Act, the memo said, the Defense Department would be reimbursed for all costs incurred.

The sites will be run by HHS employees or contractors working with them, the memo said. They will provide care to the children, “including supervision, meals, clothing, medical services, transportation or other daily needs,” and HHS representatives will be at each location.

The memo, first reported on by The Washington Post, was sent to lawmakers Wednesday after President Trump reversed his administration’s unpopular policy to separate children from their parents as the migrants arrived at the southern U.S. border.

A migrant mother waits with her children on their way to a port of entry to ask for asylum in the United States on June 21 in Tijuana, Mexico. (Mario Tama/Getty Images)

The president’s executive order directed Defense Secretary Jim Mattis to “take all legally available measures” to provide Homeland Security Secretary Kirstjen Nielsen with “any existing facilities available for the housing and care of alien families” and the construction of new facilities “if necessary and consistent with law.”

The Trump administration spent months planning, testing and defending its family separation policy at the border, taking more than 2,500 children from their parents in the six weeks before the president signed an executive order Wednesday bringing the practice to a halt.

The U.S. government has been examining for weeks whether it can use military bases to house migrant children. Representatives from HHS visited three bases in Texas — Fort Bliss, Dyess Air Force Base and Goodfellow Air Force Base — last week to review their facilities for suitability, and they were scheduled to review Little Rock Air Force Base in Arkansas on Wednesday, Davis said.

The Obama administration set up temporary centers in 2014 at three military bases: Fort Sill in Oklahoma, Lackland Air Force Base in Texas and Naval Base Ventura County in California.

Asked about the possibility of military bases being involved again, Mattis said Wednesday that the Defense Department would “see what they come up with” in HHS, and that the Pentagon would “respond if requested.”

Mattis dismissed concerns about housing migrants on military bases, noting that the Defense Department has done it on several occasions and for several reasons.

“We have housed refugees,” he said. “We have housed people thrown out of their homes by earthquakes and hurricanes. We do whatever is in the best interest of the country.”

The secretary, pressed on the sensitivities of the Trump administration separating children from their parents, said reporters would need to ask “the people responsible for it.”

“I’m not going to chime in from the outside,” he said. “There’s people responsible for it. Secretary Nielson, obviously, maintains close collaboration with us. You saw that when we deployed certain National Guard units there, so she’s in charge.”

Sen. Jack Reed (R.I.) and Rep. Adam Smith (Wash.), the top Democrats on the Senate and House Armed Services committees, wrote a letter to Mattis on Wednesday requesting assurances that members of Congress would have access to any migrant facility established on a military base. The letter, sent before Trump dropped his administration’s family-separation policy, said it was essential to have access even in cases where only short notice is provided.

Mattis has approved temporarily detailing 21 military attorneys to the Justice Department to help with the glut of immigration cases that have emerged on the border. The order, issued this month, calls for 21 attorneys with criminal-trial experience to assist as special assistant U.S. attorneys for 179 days, Davis said. They will help in prosecuting border immigration cases, he added, “with a focus on misdemeanor improper entry and felony illegal reentry cases.”

The possibility was raised in a congressional hearing in May, and first reported as underway by MSNBC on Wednesday night. U.S. law permits a judge advocate lawyer to be assigned or detailed to another agency, including to provide representation in civil and criminal cases.

This report was originally published at 2:44 p.m. with an update at 4:39 p.m. when a Pentagon spokesman confirmed that the Defense Department will support HHS’s request.

Correction: An earlier version of this post incorrectly listed Rep. Adam Smith’s state. He is a representative from Washington state, not California.