Miles Taylor, the ex-chief of staff in the Department of Homeland Security who has spent the past two months building a case against reelecting President Trump, revealed himself Wednesday to be the presidential critic from inside the administration known only as “Anonymous.”

Taylor, who served in the administration for two years, wrote in a Medium post revealing his identity that his criticisms of Trump were “widely held among officials at the highest levels of the federal government. In other words, Trump’s own lieutenants were alarmed by his instability.”

Using the nom de plume, Taylor first wrote a scathing New York Times op-ed in 2018 purporting to be among a group of people inside the administration working to protect the country from the president’s worst instincts. The essay sent shock waves through Washington and set off a years-long guessing game of who might be its author. Anonymous reemerged in 2019 with a buzzy tell-all book, “A Warning,” that described a chaotic and reckless president who posed a threat to America.

“We alone must determine whether his behavior warrants continuance in office, and we face a momentous decision, as our choice about Trump’s future will affect our future for years to come,” Taylor wrote in the Medium post. “With that in mind, he doesn’t deserve a second term in office, and we don’t deserve to live through it.”

Trump, at a campaign rally in Arizona, vilified Taylor, calling him a “sleazebag” and a “lowlife.”

“This guy, in my opinion, he should be prosecuted. He should be prosecuted,” said the president, though it was unclear for what offense.

Earlier, Trump had tweeted: “Who is Miles Taylor? Said he was ‘anonymous’, but I don’t know him - never even heard of him. Just another @nytimes SCAM - he worked in conjunction with them. Also worked for Big Tech’s @Google. Now works for Fake News @CNN. They should fire, shame, and punish everybody.”

Shortly after Taylor revealed himself as Anonymous, White House press secretary Kayleigh McEnany issued a statement denigrating him.

“This low-level, disgruntled former staffer is a liar and a coward who chose anonymity over action and leaking over leading. He was ineffective and incompetent during his time as DHS Chief of Staff which is why he was promptly fired after only serving in this role for a matter of weeks,” she said, dismissing him as a “low-ranking official.”

A chief of staff and many senior deputies to Cabinet members are often political appointees and considered senior administration officials, though Taylor was not promoted to chief of staff until after the New York Times op-ed ran.

Taylor was a congressional aide before joining the Department of Homeland Security in 2017. He was deputy chief of staff to Kirstjen Nielsen and involved in some of the administration’s most draconian immigration policies, including the ban on travel from mostly Muslim countries and the separation of immigrant children from their parents at the border.

He regularly met with Trump during the president’s tirades about immigration before the 2018 midterm elections. Taylor served as chief of staff to Nielsen, then secretary of homeland security, before leaving in 2019.

Reaction to Taylor’s unmasking was mixed, with critics questioning the New York Times’ decision to grant anonymity to a staffer at his level, as many had been left with the impression that the author was someone in the Cabinet or more senior.

Others pointed to an interview Taylor did with CNN in August in which Anderson Cooper asked him whether he were Anonymous, to which Taylor responded: “I wear a mask for two things, Anderson: Halloween and pandemics. So, no.”

In a statement, Danielle Rhoades Ha, a spokeswoman for the Times, said the newspaper takes seriously its obligation to protect sources.

“Many important stories in sensitive areas like politics, national security and business could never be reported if our journalists violated that trust. In this case, however, the writer has personally waived our agreement to keep his identity confidential. We can confirm that he is the author of the Anonymous op-ed. We don’t plan to comment further.”

Sean Desmond of Twelve Books, publisher of “A Warning,” said it was proud of the book that “every day seems more and more prescient. Miles Taylor has been a great publishing partner and we support Miles and the true act of political courage it took to tell their story.”

While Taylor did not reveal himself until six days before the election, he’s made his blistering assessment of Trump’s character and leadership well-known.

Taylor starred in a video released during the Republican National Convention in August calling the Trump presidency “terrifying.” He also wrote a Washington Post op-ed, in which he said Trump “has governed by whim, political calculation and self-interest.”

Taylor has since been the most prominent former Trump aide to actively campaign against his former boss’s reelection.

In the Medium piece, Taylor addressed criticisms that it was cowardly to level such sobering criticisms of the president from behind a nom de plume. He did so, he wrote, to take away Trump’s ability to react to the person rather than the substance of the charges.

“At the time I asked, ‘What will he do when there is no person to attack, only an idea?’ We got the answer,” Taylor wrote. “He became unhinged. And the ideas stood on their own two feet.”

After the Times piece ran, Trump called the author “gutless” and suggested it was an act of treason. He called on the newspaper to “turn him/her over to government at once!”

In his Medium piece, Taylor urged fellow Republicans to vote for Democrat Joe Biden and urged others within the Trump administration to “quickly find their consciences” and speak out before Election Day on Tuesday.

“This election is a two-part referendum: first, on the character of a man, and second, on the character of our nation,” Taylor said. “I believe Joe Biden’s decency will bring us back together where Donald Trump’s dishonesty has torn us apart.”