President Trump tweeted Tuesday that he plans to formally nominate Chad Wolf to be secretary of the Homeland Security Department, a surprise announcement that comes nearly 10 months after Wolf was installed to run DHS on an interim basis, an action a government watchdog recently called unlawful.

“I am pleased to inform the American Public that Acting Secretary Chad Wolf will be nominated to be the Secretary of Homeland Security,” Trump tweeted. “Chad has done an outstanding job and we greatly appreciate his service!”

Wolf’s long tryout period has no parallel in the 18-year history of DHS, which was created to protect the country from mass terrorism after the attacks on Sept. 11, 2001. Democrats and Republicans have viewed leadership stability at the department as a priority, but Trump has had five DHS chiefs. Just two — John F. Kelly and Kirstjen Nielsen — were formally nominated and received Senate confirmation.

Trump’s nomination of Wolf might be little more than symbolic, with the November presidential election just over two months away and Wolf’s chances of a confirmation vote unclear. A former transportation lobbyist who has never served in law enforcement or held elected office, Wolf was confirmed as the DHS undersecretary for strategy, policy and plans in a 54-to-41 vote on Nov. 13, 2019. The White House installed him as acting DHS secretary that day.

Wolf has since earned the scorn of many Democrats and some Republicans for sending federal agents to confront protesters in Portland, Ore., among other actions. Though Trump initially favored other DHS figures for the department’s top job, Wolf has emerged as an outspoken defender of the president in recent months, delighting his boss.

“I think given his past actions, he’s an awful choice,” Sen. Charles E. Schumer (D-N.Y.) told reporters after the president’s tweet.

The White House has faced criticism from both parties for leaving so many senior positions at DHS unfilled and for relying on “acting” leaders on a long-term basis.

“Cleanup attempt after you illegally appointed him,” read a tweet from the Democratic-led House Homeland Security Committee.

The Government Accountability Office said in a report published Aug. 14 that Wolf’s appointment as acting DHS secretary was unlawful, as was the installation of Ken Cuccinelli as the acting deputy secretary. Both have been serving under an “invalid order of succession” under the Vacancies Reform Act, the GAO said.

The GAO finding does not require the two men to step down, but it has left the department’s policies more vulnerable to court challenges, legal experts say.

The Vacancies Reform Act also limits to 210 days the amount of time a department head can retain the “acting” title, which Wolf has exceeded.

Trump has repeatedly said he prefers having Cabinet officials serve on an acting basis because he thinks it makes it easier to fire them.

“I like ‘acting,’ ” Trump told reporters last year. “It gives you great, great flexibility.”

DHS has not had a Senate-confirmed secretary since April 2019, when Trump ousted Nielsen and replaced her with Kevin McAleenan. McAleenan served seven months as acting chief before he resigned; he struggled to gain the president’s trust, and he was never formally nominated to the secretary job.

Wolf joined the Trump administration in 2017 as the chief of staff at the Transportation Security Administration. He later served as chief of staff to Nielsen. Wolf’s replacement in that role, former DHS chief of staff Miles Taylor, has denounced the president in recent weeks in public statements and social media posts, becoming the most senior former Trump administration official to endorse Democratic presidential nominee Joe Biden.

Erica Werner contributed to this report.