WASHINGTON — Daily attempts by undocumented immigrants to cross into the United States from Mexico over the past month surpassed daily averages not seen since fiscal year 2006, according to Customs and Border Protection data obtained by NBC News.

The surge has maxed out the capacity of existing detention centers, and the Department of Homeland Security is now in negotiations with the Department of Defense to detain and care for the overflow on U.S. military bases, according to a DHS official and two other U.S. officials familiar with the discussions.

The Department of Health and Human Services has requested DOD support for bed space for up to 5,000 children, but DOD has not yet approved the request, according to a defense official.

On March 19, CBP officers and agents stopped or apprehended 3,974 immigrants, the highest single day since the beginning of the Trump administration. Six other days since mid-February have topped 3,595, surpassing the daily average of 3,530 in fiscal year 2006.

Those seven days are the highest on record since President Donald Trump took office, a DHS official told NBC News, and they have all been recorded over the past six weeks.

The U.S. officials and a DHS official told NBC News they are working on a plan that would allow defense funds and personnel to be used in transporting immigrants in need of medical transport. The request from the DHS includes the use of DOD land to build facilities that would house detained migrants while they await deportation or an asylum hearing.

The Trump administration has already deployed thousands of U.S. troops to the border to help reinforce existing barriers, such as by hanging wire over fencing, and has plans to keep them there into September.

Those troops do not have direct involvement with immigrants, and Defense officials are wary of having uniformed military personnel come in contact with or transport migrants, two officials told NBC News.

Under a U.S. law known as the Posse Comitatus Act, the military cannot be used to enforce domestic law, drawing a barrier between troops and migrants.

Undocumented immigrants crossing now, including those presenting themselves at legal ports of entry and those apprehended while crossing illegally, are overwhelmingly families. For example, on March 12, CBP encountered 2,022 migrants who arrived as part of families, meaning children and parents traveling together, out of a total of 3,834 migrants crossing that day.

Children present new challenges for U.S. border agents. In December, two children died in CBP custody after making long journeys through remote areas to get to the U.S. Also, a federal court decision known as the Flores settlement keeps the DHS from holding children, even those with their parents, in custody for longer than 20 days.

The influx has caused CBP to begin releasing immigrants without transferring them to Immigration and Customs Enforcement custody. The immigrants are often released in large numbers, overwhelming local charities and shelters, and given a notice to appear in court at a later date, according to a DHS official.

The use of DOD land will allow the DHS to find additional space to detain immigrants, rather than releasing them. Last year the Pentagon identified Fort Bliss and Goodfellow Air Force Base, both in Texas, as two possible locations to house migrants. It is not yet known what land will be identified or whether the detention space will hold families or single adults.

A Pentagon spokesperson confirmed site surveys were completed at both Goodfellow AFB and Fort Bliss last y ear, but said there has still been no request to begin housing migrants on U.S. military bases. "DOD will not begin constructing additional shelters until DOD receives a notice of intent from either DHS or HHS requesting that DOD start construction," Lt. Col. Jamie Davis said. "At this time, DOD has not received notification."