U.S. Attorney for Massachusetts Andrew Lelling will resign from his office at the end of February after nearly four years as the top federal prosecutor in the state, his office announced Wednesday.

Lelling, who was appointed U.S. attorney by former President Trump and confirmed to the position in the U.S. Senate, said he gave President Joe Biden his resignation earlier this week. Until Biden appoints a successor, First Assistant U.S. Attorney Nathaniel Mendell will serve as acting U.S. attorney.

Last month, the Boston Globe reported that the four finalists for the U.S. attorney position are Suffolk District Attorney Rachael Rollins; Josh Levy, a partner at Ropes & Gray; and two people who already work in the U.S. attorney's office in Massachusetts, chief of the civil rights unit Jennifer Serafyn and Springfield office head Deepika Bains Shukla.

As U.S. attorney, Lelling's office charged 11 current and former members of the State Police and 10 current and former members of the Boston Police Department for fraudulent overtime practices and other corruption, indicted former Rep. David Nangle of Lowell for alleged fraud, and charged a state district court judge for alleged obstruction of justice. His office also oversaw the "Varsity Blues" investigation into corruption in college admissions, "prioritized rooting out drug trafficking and violent offenders in Lawrence," and was the only U.S. attorney's office in the country to use the Americans with Disabilities Act to require nursing facilities and county jails to provide medication-assisted treatment to recovering addicts, Lelling's office said.

Prior to his current post, Lelling was the office's senior litigation counsel and had previously worked as a federal prosecutor in the Eastern District of Virginia and was counsel to the assistant attorney general at the Department of Justice's Civil Rights Division.

It is not uncommon for a U.S. attorney appointed by an outgoing or former president to step aside when a new president assumes office. Former U.S. Attorney Carmen Ortiz, an Obama administration appointee, resigned one week before Trump took office in 2017.

Lelling's office did not hint at what his next venture may be, but he has previously suggested that he might consider running for political office.

"Yeah I’ve thought about that," Lelling told the Boston Herald last month. "I wouldn’t foreclose it. I think it is possible I could pursue something in politics."