PHOTO: Ron Sachs/Andrew Cabellero-Reynolds/Getty Images
Now playing
02:24
Secret Service head ousted as DHS shakeup continues
US President Joe Biden delivers remarks before signing an Executive Order in the South Court Auditorium at the White House on January 25, 2021 in Washington, DC. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
US President Joe Biden delivers remarks before signing an Executive Order in the South Court Auditorium at the White House on January 25, 2021 in Washington, DC. (Photo by JIM WATSON / AFP) (Photo by JIM WATSON/AFP via Getty Images)
PHOTO: Jim Watson/AFP/Getty Images
Now playing
02:50
Biden thinks US can get to 1.5 million vaccine doses daily
TAMPA, FL - AUGUST 29:  U.S. Sen. Rob Portman (R-OH) waves during the third day of the Republican National Convention at the Tampa Bay Times Forum on August 29, 2012 in Tampa, Florida. Former Massachusetts Gov. Former Massachusetts Gov. Mitt Romney was nominated as the Republican presidential candidate during the RNC, which is scheduled to conclude August 30.  (Photo by Mark Wilson/Getty Images)
TAMPA, FL - AUGUST 29: U.S. Sen. Rob Portman (R-OH) waves during the third day of the Republican National Convention at the Tampa Bay Times Forum on August 29, 2012 in Tampa, Florida. Former Massachusetts Gov. Former Massachusetts Gov. Mitt Romney was nominated as the Republican presidential candidate during the RNC, which is scheduled to conclude August 30. (Photo by Mark Wilson/Getty Images)
PHOTO: Mark Wilson/Getty Images
Now playing
02:16
GOP senator explains why he won't seek reelection
diegal
diegal
PHOTO: CNN
Now playing
02:58
Former Republican: We've got a bankrupt party
Now playing
02:26
See Biden sign executive order lifting transgender military ban
WASHINGTON, DC - AUGUST 10:  The Trump International Hotel is shown on August 10, 2017 in Washington, DC.  The hotel, located blocks from the White House, has become both a tourist attraction in the nation
WASHINGTON, DC - AUGUST 10: The Trump International Hotel is shown on August 10, 2017 in Washington, DC. The hotel, located blocks from the White House, has become both a tourist attraction in the nation's capital and also a symbol of President Trump's intermingling of business and politics. (Photo by Win McNamee/Getty Images)
PHOTO: Win McNamee/Getty Images
Now playing
01:56
Why SCOTUS is dismissing emolument cases against Trump
PHOTO: CNN
Now playing
02:20
Legal analyst: Dominion's case looks pretty strong
John Avlon 0125
John Avlon 0125
PHOTO: CNN
Now playing
03:08
Avlon: The Republicans who stood up to Trump were our bulwark
Now playing
03:19
Some GOP lawmakers are defying Capitol security measures
PHOTO: CNN
Now playing
01:17
Sen. Romney: Senate trial after Trump leaving office is constitutional
PHOTO: CNN
Now playing
03:25
Biden's HHS secretary pick: If we do this, we will get the pandemic under control
Now playing
07:26
'What research did you do?': Brown presses GOP lawmaker on election fraud claims
PHOTO: CNN
Now playing
01:42
Acosta describes covering last day of Trump administration
WASHINGTON, DC - FEBRUARY 06: Rep. Alexandria Ocasio-Cortez (D-NY) attends a press conference with Rep. Andy Levin (D-MI) about their new bill called the EV Freedom Act on Capitol Hill on February 6, 2020 in Washington, DC. The EV Freedom Act is a plan to create a nation wide charging infrastructure for electric vehicles. (Photo by Samuel Corum/Getty Images)
WASHINGTON, DC - FEBRUARY 06: Rep. Alexandria Ocasio-Cortez (D-NY) attends a press conference with Rep. Andy Levin (D-MI) about their new bill called the EV Freedom Act on Capitol Hill on February 6, 2020 in Washington, DC. The EV Freedom Act is a plan to create a nation wide charging infrastructure for electric vehicles. (Photo by Samuel Corum/Getty Images)
PHOTO: Samuel Corum/Getty Images
Now playing
03:35
Rioter charged with threatening to 'assassinate' Ocasio-Cortez, officer
Now playing
02:41
Loyal Texas Trump voters want Biden to be less divisive
Now playing
01:16
Sen. Patrick Leahy doubles as a Batman actor
(CNN) —  

President Donald Trump is cleaning house in the Department of Homeland Security.

Homeland Security Secretary Kirstjen Nielsen and Secret Service Director Randolph “Tex” Alles have been ousted, and at least two officials have been named as possibly heading out the door: US Citizenship and Immigration Services director Francis Cissna and Office of the General Counsel’s John Mitnick.

“There is a near-systematic purge happening at the nation’s second-largest national security agency,” an official told CNN.

At least some of the sudden personnel changes come at the urging of White House senior adviser Stephen Miller, who played a key role in Nielsen’s ouster. The President in recent weeks empowered Miller to lead the administration’s border policies “and he’s executing his plan” with what amounts to a wholesale decapitation of the department’s leadership, an official said.

RELATED: How border hardliners nudged out Nielsen

The President has also pushed in recent weeks to reinstate the family separation policy, which Nielsen resisted, a source familiar with the discussions says. Trump rescinded that policy amid public outrage and scrutiny from the courts last summer.

Miller’s heightened influence within the West Wing has been aided by the President, who recently told aides in an Oval Office meeting that Miller was in charge of all immigration and border-related issues in the White House, according to a person familiar with the meeting.

Trump administration officials say Miller wants the President to dismiss Cissna and Mitnick.

Miller has always informally been one of the leading hardliner voices on immigration in the West Wing. But this change formalizes that role and gives him the ability to call and chair meetings on immigration issues. The change was first reported by The Washington Post.

The sudden shift in personnel is indicative of the White House trying to redirect immigration policy following a surge of migrant apprehensions at the southern border in recent months.

Additionally, after Trump walked back his threat to close the US-Mexico border and praised Mexico for doing more to stop the flow of immigrants, he has since soured on his own walkback. By the end of the week, the President became frustrated once again about the issues at the border, dissatisfied that Mexico was not doing enough and looking for his aides to take tougher steps to address the problem.

The changes have left the department in limbo, which has had at least three positions filled by people in an acting capacity in senior roles.

A senior administration official said that under the law, DHS Under Secretary of Management Claire Grady, the current acting deputy secretary, is next in line of succession to be acting secretary. That means there are questions as to whether she will need to be fired as well in order to make Customs and Border Protection Commissioner Kevin McAleenan the acting DHS secretary, as Trump tweeted Sunday night.

Late last week, the White House abruptly withdrew the nomination of Ron Vitiello for director of Immigration and Customs Enforcement, which caught Congress and the department by surprise. Nielsen was unaware what was happening until after the nomination was pulled, a person familiar with the news said.

“It’s pretty somber over here,” said an ICE official, adding that there are still questions about why Vitiello’s name was withdrawn.

’You’ve got a hard job’

Nielsen had been on thin ice for some time. After the 2018 midterm elections, she and her advisers strongly suspected that she would not survive long. The President had long talked about making changes to his Cabinet after the midterms, and Trump was increasingly calling for drastic action to curb migration at the southern border.

Nielsen realized that optics were what mattered most to Trump – that’s when she began to adopt a harder line and make a more public case for the President’s immigration policies. In private, she also tried to adjust her style when talking to Trump, offering him workarounds to existing laws rather than simply telling him what he wanted at the border was not possible.

It all ingratiated her to Trump, according to multiple sources, and the President began to believe Nielsen might be the right person to implement his agenda despite the challenges of the job.

“You’ve got a hard job,” the President told her at the time, a source familiar with the comments said.

At the same time, Nielsen worked with one of the President’s closest advisers, his son-in-law, Jared Kushner, to broker a deal with Mexico that would allow some asylum seekers to wait in that country while their claims were processed. Nielsen also felt that forging a closer relationship with Kushner could help her get more stability in the job.

She entered 2019 feeling that she had earned that stability. In February, she reshuffled her senior staff and began to eye additional senior hires.

But the ground shifted under her faster than she could adjust. She began to grow concerned that her position might be in danger last week, when a newly empowered Miller indicated there would be a shake-up in several deputy-level positions at DHS.

Nielsen tried to find solutions to the administration’s chaotic response to the situation at the border that would allow her to remain in her position. She started to talk to White House chief of staff Mick Mulvaney about bringing on an immigration czar to coordinate the administration’s response – and take some of the heat off herself.

Ultimately, neither that nor her attempts to turn up the volume on her rhetoric were enough.

“The situation at the border just deteriorated super quickly,” one source close to Nielsen said.

RELATED: It may take 2 years to identify thousands of separated families, government says

Asked about the mood at DHS following Nielsen’s resignation, one DHS official told CNN there was “some exasperation,” adding that the department doesn’t “have enough depth” to fill longtime vacancies.

“We are losing leadership faster than we can get it confirmed or even hired permanently,” the official said.

CNN’s Evan Perez contributed to this report.