Environmental Protection Agency Administrator Scott Pruitt resigned on Thursday, President Donald Trump announced in a tweet, bringing to an end a tenure in which the agency created to enforce environmental laws instead became a powerful tool of those it was tasked with regulating.

“I have accepted the resignation of Scott Pruitt as the Administrator of the Environmental Protection Agency,” Trump tweeted. “Within the Agency Scott has done an outstanding job, and I will always be thankful to him for this.”

Trump added that Andrew Wheeler, Pruitt’s deputy at the EPA, would assume the administrator’s duties on Monday. A former energy industry lobbyist, Wheeler will likely maintain the deregulatory policy track that Pruitt pursued in his year and a half on the job.

“Mr. President, it has been an honor to serve you,” Pruitt wrote in his resignation letter. But “the unrelenting attacks on me personally, my family, are unprecedented and have taken a sizable toll on all of us.”

Pruitt’s departure comes amidst declining morale at the agency, which has been racked by turnover over the last few months. In the minutes following the announcement of the resignation, The Daily Beast received numerous messages from multiple former EPA staffers, and current White House officials, celebrating the news. Some were simply left in shock that his ouster from the Trump administration actually, finally happened.

Pruitt’s resignation follows a series of widening ethics scandals that were set into motion almost immediately after his narrow confirmation in February 2017. In fact, as of Thursday, Pruitt had 19 open investigations into his conduct at the EPA. It was Trump’s personal affinity for Pruitt, and approval of his efforts to roll back Obama-era environmental regulations, that kept him in the job in spite of that controversy. But damaging revelations continued to trickle out, with no apparent end in sight.

Pruitt initially came under fire from the left for wide-ranging actions seen as dismantling President Barack Obama’s environmental legacy: slashing EPA enforcement actions by more than 30 percent, instituting gag rules meant to ban staff from talking about certain environmental issues, and even creating a blacklist of agency employees who worked on anthropogenic climate change.

But it was Pruitt’s personal conduct as EPA administrator that likely prompted his removal—most recently, news that his top aides had retroactively purged his official calendar of politically problematic entries, including a 2017 meeting in Rome with a cardinal under investigation at the time over sexual abuse allegations.

By the time Pruitt resigned, the intensely poor morale that he had created among his staff had led to a constant leak of damaging information from current and former aides. A number of them, chiefly former deputy chief of staff Kevin Chmielewski, alleged that Pruitt had retaliated against them for objecting to official misconduct by the administrator, allegations that are now the subject of an investigation by the U.S. Office of Special Counsel.

On top of the alleged corruption and chronic ethical lapses, Pruitt also appeared to maintain a streak of vindictiveness, sometimes aimed directly at those once most loyal to him. As The Daily Beast reported last week, Pruitt personally authorized and actively participated in what sources dubbed “ ratfucking ” campaigns against his former aides and loyalist who he perceived as having turned on him. In some cases, he went as far to try to ruin his former subordinates' reputations, credibility, and career prospects.

A member of the House Oversight Committee called for congressional hearings to examine those allegations in the wake of a Daily Beast story this week detailing Pruitt’s efforts to undercut former aides whom he felt had embarrassed him publicly.

Other scandals swirling around the administrator pertained to conflicts of interest that seemed to pervade his tenure, particularly revelations that during his first months in Washington, D.C., he paid $50 per night to live in a lobbyist-owned condo just steps away from the Capitol.

The lobbyist, J. Steven Hart, not only lobbied the EPA on behalf of clients but also donated to Pruitt while he served as Oklahoma’s attorney general. While Pruitt stayed at the Hart condo, several Republican lawmakers hosted fundraisers there.

Pruitt has insisted that the lobbyist whose townhouse he lived in “has no clients who have business before this agency,” but records obtained by The Daily Beast show that the lobbyist personally represented at least three clients that had business before the agency. At the time he was renting out the room to Pruitt, Hart personally represented a natural gas company, an airline giant, and a major manufacturer that had business before the EPA.

Beyond that scandal, Pruitt’s standing in the administration was also weakened after the Atlantic reported that he had gone around White House objections to secure pay increases to two close aides. Pruitt denied knowing that an obscure environmental law had been used to get those raises enacted—an assertion that was challenged aggressively by even conservative media. And in an interview with Fox News in April, he likened his living situation to “an AirBnB situation.”

But Pruitt’s cut-rate couchsurfing overshadowed his fondness for cushy travel on the taxpayer’s dime.

Documents obtained last month by The Daily Beast found that Pruitt had spent roughly $105,000 on first-class airfare since assuming the post. Pruitt also spent roughly $58,000 on charter and military flights in the first seven months at the agency, according to records obtained by congressional overseers.

Those expenditures eventually drew the ire of congressional Republicans, prompting Rep. Trey Gowdy (R-S.C.), chair of the House Oversight Committee, to produce all documents related to Pruitt’s travel expenses. The EPA initially blew past the deadline to submit those documents, before submitting them two weeks late.

EPA security officials initially defended the expenditures as necessary for Pruitt’s safety, citing “profanities being yelled at him” in airports as examples of the risks faced by Pruitt, who also traveled with a security guard.

Closer examinations revealed that Pruitt's profligacy extended to other aspects of his job, including $43,000 spent on the installation of a soundproof phone booth at EPA headquarters and spending thousands of dollars on anti-surveillance sweeps of his office.

Other cabinet officials have survived scrutiny of similarly lavish misuse of taxpayer money: Housing and Urban Development Secretary Ben Carson was forced to cancel an order for a $31,000 dining set for his office after news of the expense broke; the Treasury Department was revealed to have spent more than $800,000 for Secretary Steven Mnuchin’s travel on government airplanes, including one $33,000 jaunt with his wife to Kentucky that happened to coincide with a nearby solar eclipse.

Pruitt’s appetite for luxury air travel was so ravenous that aides briefly considered leasing a private jet for his use, the Washington Post reported, at a cost of roughly $100,000 per month.

Pruitt is only thelatest member of President Trump’s cabinet to leave his post in the face of alleged ethics violations. Veterans Affairs Secretary David Shulkin was fired in March, and Health and Human Services Secretary Tom Price resigned in September.