Elaine Duke, the No. 2 official at the Department of Homeland Security (DHS), is stepping down from her post in the Trump administration.

Duke, the agency's deputy secretary who played a key role at the helm of DHS last year, is set to leave in April, Homeland Security Secretary Kirstjen Nielsen announced Friday afternoon.

"Elaine has selflessly served the federal government for three decades, and this Department for more than 10 years spanning multiple Secretaries," Nielsen said in a statement.

"Since taking office, she has been instrumental in helping the Department address emerging threats and in preparing for, responding to, and recovering from the 2017 hurricane season."

Duke is leaving the Trump administration after serving in the federal government for nearly three decades, under both Republican and Democratic presidents.

President Trump nominated her for the No. 2 position at DHS in January 2017, and she formally took office in April. She later would serve for several months at the helm of DHS as acting secretary after Trump tapped then-DHS Secretary John Kelly as his new White House chief of staff. Duke served in the post until Nielsen was confirmed in December.

During her time as the top DHS official starting in late July, Duke oversaw the department's response to a series of hurricanes that devastated parts of Texas, Louisiana and Florida, as well as U.S. territories in the Caribbean.

Duke came under fire, however, after she suggested that the federal response to Hurricane Maria, which devastated Puerto Rico, was a "good news story."

Duke also reportedly faced pressure from Kelly, who urged her in November to deport thousands of Hondurans residing in the U.S. after DHS extended temporary protected status for the residents.

According to a Washington Post report, that episode angered Duke, who refused to reverse the decision to extend the residency permits.