PHOTO: Ron Sachs/Andrew Cabellero-Reynolds/Getty Images
Now playing
02:24
Secret Service head ousted as DHS shakeup continues
PHOTO: CNN
Now playing
02:09
Lawmaker slams riot: 'Damned if I'll let it' shake faith in democracy
PHOTO: CNN
Now playing
04:01
Raskin: I'm not losing my son in 2020 and my country in 2021
Now playing
01:19
Sen. King: Cutting off Trump's intel access should be easy decision for Biden
A sign for the National Security Agency (NSA), US Cyber Command and Central Security Service, is seen near the visitor
A sign for the National Security Agency (NSA), US Cyber Command and Central Security Service, is seen near the visitor's entrance to the headquarters of the National Security Agency (NSA) after a shooting incident at the entrance in Fort Meade, Maryland, February 14, 2018. - Shots were fired early Wednesday at the ultra-secret National Security Agency, the US electronic spying agency outside Washington, leaving one person injured, officials said. Aerial footage of the scene from NBC News showed a black SUV with numerous bullet holes in its windshield crashed into concrete barriers at the main entrance to the NSA's headquarters in Fort Meade, Maryland. (Photo by SAUL LOEB / AFP) (Photo by SAUL LOEB/AFP via Getty Images)
PHOTO: Saul Loeb/AFP/Getty Images
Now playing
01:31
Christopher Miller orders NSA chief to install Trump loyalist as agency's top lawyer
Now playing
02:38
Biden: Science team 'among the brightest, most dedicated'
US President Donald Trump boards Air Force One before departing Harlingen, Texas on January 12, 2021. (Photo by MANDEL NGAN / AFP) (Photo by MANDEL NGAN/AFP via Getty Images)
US President Donald Trump boards Air Force One before departing Harlingen, Texas on January 12, 2021. (Photo by MANDEL NGAN / AFP) (Photo by MANDEL NGAN/AFP via Getty Images)
PHOTO: Mandel Ngan/AFP/Getty Images
Now playing
04:09
Fact Check: The lies that could define Trump's legacy
The Atlantic Ocean is seen adjacent to President Donald Trump
The Atlantic Ocean is seen adjacent to President Donald Trump's beach front Mar-a-Lago resort, also sometimes called his Winter White House, the day after Florida received an exemption from the Trump Administration's newly announced ocean drilling plan on January 11, 2018 in Palm Beach, Florida.
PHOTO: Joe Raedle/Getty Images
Now playing
03:19
Donald Trump's plan to move to Mar-a-Lago faces challenges
Trump talks to reporters while hosting Republican Congressional leaders and members of his cabinet in the Oval Office at the White House July 20, 2020 in Washington, DC.
Trump talks to reporters while hosting Republican Congressional leaders and members of his cabinet in the Oval Office at the White House July 20, 2020 in Washington, DC.
PHOTO: Doug Mills/Pool/Getty Images
Now playing
01:19
Historian on Trump's legacy: He's an 'asterisk president'
Mike Pence remarks vpx
Mike Pence remarks vpx
PHOTO: Senate TV
Now playing
02:27
New timeline shows just how close rioters got to Pence and his family
PHOTO: CNN
Now playing
01:48
FBI warns of potential armed protests across country
MyPillow notes
MyPillow notes
PHOTO: Jabin Botsford
Now playing
02:21
Photographer snaps notes of MyPillow CEO after visiting Trump
PHOTO: CNN
Now playing
04:31
Congressman concerned about being harmed by fellow lawmakers
Metropolitan Police Officer Michael Fanone
Metropolitan Police Officer Michael Fanone
PHOTO: CNN
Now playing
04:56
DC officers speak out following Capitol riot
Senator-elect Tommy Tuberville, a Republican from Alabama, stands for a photo at the US Capitol in Washington, DC, on November 9, 2020. (Photo by Stefani Reynolds / POOL / AFP) (Photo by STEFANI REYNOLDS/POOL/AFP via Getty Images)
Senator-elect Tommy Tuberville, a Republican from Alabama, stands for a photo at the US Capitol in Washington, DC, on November 9, 2020. (Photo by Stefani Reynolds / POOL / AFP) (Photo by STEFANI REYNOLDS/POOL/AFP via Getty Images)
PHOTO: STEFANI REYNOLDS/AFP via Getty Images
Now playing
03:20
Senator-elect Tommy Tuberville flubs 3 branches of government
MOON TOWNSHIP, PA - SEPTEMBER 22: Ivanka Trump and Jared Kushner listen as President Donald Trump speaks at a campaign rally at Atlantic Aviation on September 22, 2020 in Moon Township, Pennsylvania. Trump won Pennsylvania by less than a percentage point in 2016 and is currently in a tight race with Democratic nominee, former Vice President Joe Biden. (Photo by Jeff Swensen/Getty Images)
MOON TOWNSHIP, PA - SEPTEMBER 22: Ivanka Trump and Jared Kushner listen as President Donald Trump speaks at a campaign rally at Atlantic Aviation on September 22, 2020 in Moon Township, Pennsylvania. Trump won Pennsylvania by less than a percentage point in 2016 and is currently in a tight race with Democratic nominee, former Vice President Joe Biden. (Photo by Jeff Swensen/Getty Images)
PHOTO: Jeff Swensen/Getty Images
Now playing
01:55
Where do Ivanka Trump and Jared Kushner go from here?
(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.