The agency in charge of dealing with overcrowded conditions at migrant facilities near the southern border is severely understaffed at the leadership level.

The president has demanded the Department of Homeland Security contain the surge of immigrants at the border and deport millions who are in the country illegally. But he has failed to staff the highest levels of the agency and its departments, which include Customs and Border Protection and Immigration and Customs Enforcement.

Homeland Security now has the lowest percentage of Senate-confirmed presidential appointments of any agency in the federal government, according to data from the Partnership for Public Service, a nonpartisan nonprofit that tracks key executive branch nominations.

Only 41 percent of the top jobs at the agency are filled by personnel confirmed by the Senate, the group's data shows. That's down from 56 percent in March. Among the positions with no nominees are the two top jobs at the agency: secretary and deputy secretary.

Download the NBC News app for breaking news and politics

"It's a real problem," the group's president and CEO Max Stier told NBC News. "You're creating uncertainty for the present and landmines for the future. There's a set of big issues we face as a country and not to have confirmed highly qualified leadership in place means the government is not serving the public."

Overall, the administration has made some headway in dealing with the number of vacancies in executive branch posts that require Senate confirmation — there are now a total of 258 positions out of more than 700 top positions awaiting a nomination or confirmation, compared to 270 in May.

The gains would be more pronounced if not for the tumult at the DHS, where "there are multiple positions that have been filled many times" because of an unprecedented volume of turnover, Stier said.

Trump pushed out DHS Secretary Kirstjen Nielsen and her deputy in April, and named Kevin McAleenan acting secretary. He's the fourth person to hold the position since Trump took office, but the president has yet to officially nominate him for the job.

McAleenan had been the head of Customs and Border Protection, so his appointment created another opening there.

John Sanders became acting head of CBP, but announced he was resigning late last month. "I don't think I've ever spoken to him," Trump said afterwards. "We're moving some people around into different locations."

Sanders is being replaced by Mark Morgan — who had just become the acting head of ICE in May. Trump had nominated ICE acting director Ronald Vitiello for the permanent job, but pulled his nomination and nominated Morgan instead because, he said, he wanted someone "tougher."

Mark Morgan, chief of the US Border Patrol, testifies at a Senate Homeland Security and Governmental Affairs Committee hearing on "Initial Observations of the New Leadership at the US Border Patrol" on Capitol Hill on Nov. 30, 2016. Nicholas Kamm / AFP - Getty Images file

That means the person who preceded Morgan as acting ICE director, Matthew Albence, will now replace him as acting ICE director.

It's unclear when, or even if, some of Trump's latest appointments will ever be formally nominated.

The president pushed out longtime DHS veteran Francis Cissna as head of U.S. Citizenship and Immigration Services last month and named immigration hard-liner Ken Cuccinelli acting director.

There's bipartisan opposition to Cuccinelli's appointment — Democrats don't like his policies, and Republicans aren't keen on his political track record: his anti-establishment political action committee has targeted several GOP senators, including Senate Majority Leader Mitch McConnell.

"He’s spent a fair amount of his career attacking Republicans in the Senate, so it strikes me as an odd position for him to put himself in to seek Senate confirmation,” Sen. John Cornyn, R-Texas, told Politico last month. “It’s unlikely he’s going to be confirmed if he is nominated.”

Acting Director of the U.S. Citizenship and Immigration Services (USCIS) Ken Cuccinelli attends a naturalization ceremony inside the National September 11 Memorial Museum in New York on July 2, 2019. Drew Angerer / Getty Images

Stier said the number of acting chiefs is hurting the DHS and its 240,000 employees who are looking for stable leadership.

"It undermines the ability of the agency to perform at its best," he said, making it difficult to recruit talent and plan for the future. And moving people around between different agencies under the DHS umbrella is hardly a solution, given the demands and differences of each one.

"It's not like you can move in and jump in and be fully up to speed, nor will the organization see you as such. These are hard, complicated jobs," he added.

"This is not a statement about the quality of the individuals in those positions. They are placed in an operational posture that doesn't allow them to be fully effective," Stier said, adding that the agency officials "perform a diverse and really important set of functions for our safety and our country."

The leadership carousel is also sparking confusion outside of the DHS.

Senate Minority Leader Chuck Schumer on Wednesday called for Morgan to be fired because of how CBP has handled the overcrowding at the migrant centers at the border.

Morgan, who is still at ICE, doesn't start at CBP until Monday.