Several U.S. military bases may soon house illegal immigrant children caught crossing the border, two government officials told the Associated Press.

The Health and Human Services Department is also considering using the bases to shelter children who were separated from their parents while illegally entering the country, the officials reportedly said.

Illegal immigrant children are often separated from their parents for their own welfare, or because their parents are facing criminal charges.

The sources discussed the plan Tuesday on condition of anonymity because it has not been made public or made final.

Health and Human Services is a federal agency that oversees approximately 100 shelters in more than a dozen states for children seized at the border. The agency's mission is to ensure the health of Americans and provide critical services.

HHS has temporarily used military bases for housing in the past. During a surge in children from Central America in 2014, the HHS temporarily used military bases in California, Oklahoma and Texas to house children.

That process was not without its critics. In 2014, Texas officials appealed to the Obama administration to secure the U.S.-Mexico border as waves of illegal immigrant children overwhelmed the system, with one lawmaker saying U.S. military bases effectively have been transformed into camps to handle the influx.

"Our military bases are turning into refugee camps. I never thought I'd see this in the United States of America," House Homeland Security Committee Chairman Michael McCaul, R-Texas, said at the time.

WATCH: UNIVERSITY TRAINS STUDENTS TO HELP ILLEGAL IMMIGRANTS

The Department of Homeland Security has limited space to house families that are kept together — only about 2,700 beds at three family detention centers in Texas and Pennsylvania. In April alone, people who came as families accounted for nearly 10,000 Border Patrol arrests. Another 4,300 were unaccompanied children.

"Our military bases are turning into refugee camps." — House Homeland Security Committee Chairman Michael McCaul

Nearly 1 in 4 Border Patrol arrests on the Mexican border from October through April was someone who came in a family. That means any large increase in prosecutions will likely cause parents to be separated from their children while they face charges and do time in jail.

Homeland Security Secretary Kirstjen Nielsen defended the Trump administration's practice of separating children from parents when the family is being prosecuted for entering the U.S. illegally, telling a Senate committee Tuesday that removing children from parents facing criminal charges happens "in the United States every day."

Nielsen, who has led the agency since December, came under attack from Democratic senators days after Attorney General Jeff Sessions said a "zero tolerance" policy toward people entering the country illegally could lead to more families being split up while parents are prosecuted.

CALIF. LAWMAKER PROPOSES ALLOWING ILLEGAL IMMIGRANTS TO SERVE ON STATE BOARDS

In a contentious exchange with Sen. Kamala Harris, D-Calif., Nielsen said her department was not taking children from parents as a way to deter illegal immigration. Rather, Nielsen said, if a person crosses the border illegally: "We will refer you for prosecution. You've broken U.S. law."

When Harris pressed her about what that would mean for a 4-year-old child whose family faces charges of entering the country illegally, Nielsen said, "What we'll be doing is prosecuting parents who've broken the law, just as we do every day in the United States of America."

The children are transferred to the custody of Health and Human Services within 48 hours, she said. That department then finds people for the children to stay with while the parents are in custody, she said.

The Associated Press contributed to this report.