Elaine Duke, then-acting secretary of Homeland Security, testifies before Congress in September. (Melina Mara/The Washington Post)

Elaine Duke, the second-highest-ranking official at the Department of Homeland Security, announced Friday that she will step down after serving less than a year in the job.

A longtime Homeland Security official who ran the agency as acting secretary for more than four months last year, Duke, now deputy secretary, is a well-regarded figure at DHS and viewed as one of its most experienced managers. But Duke was largely sidelined after Secretary Kirstjen Nielsen took over in December and given a portfolio described as “embarrassingly light,” according to people familiar with the matter.

In a brief statement, Nielsen said Duke would “retire from government service in April,” having “selflessly served the federal government for three decades.”

Duke worked as a top-ranking DHS official under President George W. Bush, and was recruited back to the agency by then-Secretary John F. Kelly. Duke was confirmed by the Senate last April.

When Kelly moved to the White House to be chief of staff a few months later, Duke became acting DHS secretary. She filled the top role for more than four months, the longest tenure of any DHS leader serving in an temporary capacity.

“She ended up taking over for Kelly during a tumultuous time at DHS — with three hurricanes, and having to navigate complicated waters on immigration,” said James Norton, a former DHS official who worked with Duke during the Bush administration. 

Norton called her departure “a real loss for our country.”

After Hurricane Maria devastated Puerto Rico, Duke was heavily criticized for saying the government’s response should be viewed as “a good news story.” White House officials generally credited her with successful management of the crisis.

But Duke’s standing in the administration tumbled in November when she refused to expel some 57,000 Hondurans living in the United States for nearly two decades with a form of provisional residency known as temporary protected status. 

The White House wanted Duke to cancel the Hondurans’ TPS permits, and Kelly called Duke to pressure her, officials said at the time. The episode upset Duke, and she told people close to her that she planned to quit, but DHS released a statement from Duke denying it.

“Upon confirmation of Kirstjen Nielsen as the next Secretary of Homeland Security, I look forward to continuing our important work as the Deputy Secretary of Homeland Security,” the statement said. “I have no plans to go anywhere and reports to the contrary are untrue.”

Duke is the second high-ranking DHS official to step down in recent weeks. James D. Nealon left his job as assistant secretary for international engagement in DHS’s Office of Strategy, Policy, and Plans earlier this month. Nealon, a former U.S. ambassador to Honduras, had reportedly also clashed with the White House over immigration policy.