WASHINGTON — Scott Pruitt, the former Oklahoma attorney general who relentlessly pursued President Trump’s promises of deregulation by the Environmental Protection Agency, resigned Thursday after controversies over his lavish spending, ethical lapses and controversial management decisions eroded the president’s confidence in one of his most ardent Cabinet members.

Pruitt’s reputation as a dogged deregulator and outspoken booster of the president allowed him to weather ethics scandals in recent months, including questions about taxpayer-funded first-class travel, a discounted condominium rental from the wife of a District of Columbia lobbyist and the installation of a $43,000 soundproof phone booth in his office.

But revelations about his behavior continued to mount, including reports that he repeatedly enlisted subordinates to help him search for housing, book personal travel and help search for a six-figure job for his wife. That quest included setting up a call with Chick-fil-A executives in which he discussed his wife’s becoming a franchisee, as well as outreach to a conservative judicial group that eventually hired Marlyn Pruitt.

In recent weeks, an exodus of trusted staffers left Pruitt increasingly isolated, and some Republican lawmakers wearied of defending him. Investigators on Capitol Hill had summoned current and former EPA aides for questioning as part of more than a dozen federal inquiries into Pruitt’s spending and management of the agency.

On Thursday, the White House informed Pruitt that he had to submit his resignation, according to two individuals who spoke on the condition of anonymity because of the sensitivity of the matter. President Trump did not speak to the administrator directly, according to a third individual, but instead called Pruitt’s top deputy, Andrew Wheeler, to inform him that he would be taking the helm of the agency.

Soon after, Trump announced in a two-part tweet that he had accepted Pruitt’s resignation. “Within the Agency Scott has done an outstanding job, and I will always be thankful to him for this,” Trump wrote.

White House chief of staff John Kelly, who traveled with Trump to a political rally in Montana on Thursday, had for months privately groused about Pruitt’s conduct and had pushed for his removal during West Wing meetings, according to White House officials who were not authorized to speak publicly. The accumulation of several new revelations about Pruitt’s conduct allowed Kelly to make a convincing case to Trump on Thursday’s flight to Montana that the stories about the administrator’s behavior would not stop, according to a senior administration official.

In a resignation letter released by the EPA, Pruitt wrote that it had been “a blessing” to serve under Trump and undertake “transformative work” at EPA. But he added that “the unrelenting attacks on me personally, my family, are unprecedented and have taken a sizable toll on all of us.”

He signed the letter, “Your Faithful Friend, Scott Pruitt.”

Trump later told reporters aboard Air Force One that there was “no final straw” that led to Pruitt’s departure, and that the move, which he said was of Pruitt’s volition, had been in the works for “a couple of days.”

“He came to me and said, ‘I have such great confidence in the administration. I don’t want to be a distraction,’ ” Trump said. “And I think Scott felt that he was a distraction.”

Wheeler,a former Senate staffer and EPA employee who spent a decade representing coal, mining and other energy companies, will become acting administrator on Monday, Trump tweeted.

Democrats and environmentalists hailed Pruitt’s exit, even as they viewed Wheeler’s rise warily and warned that he would continue many of the same policies. Sen. Thomas Carper, Del., the top Democrat on the Senate Environment and Public Works Committee, said Thursday that Pruitt’s “brazen abuse of his position” had surprised even his political opponents.

“We had a good idea what he was going to be on the policy side. We had no idea how morally bereft he would be,” Carper told reporters. “He was all the things this administration said it was opposed to. . . . He’s done a lot of damage. It can be reversed, but it’s going to take some time.”

The chairman of the Environment and Public Works Committee, Republican John Barrasso, Wyo., said that Trump “made the right decision in accepting Pruitt’s resignation. “It has become increasingly challenging for the EPA to carry out its mission with the administrator under investigation.”

During his roughly 16 months in office, Pruitt took steps to reverse more than a dozen major Obama-era regulations and overhauled key elements of the agency’s approach to scientific research. For months, he had ranked as a personal confidant and influential policy adviser to the president, commiserating with Trump over negative news coverage while praising the commander in chief for his intelligence and political acumen.

As scrutiny of Pruitt grew in recent months, Trump initially stood by his EPA chief. The president tweeted in early April that Pruitt was “doing a great job,” despite revelations about costly travel funded by taxpayers. Trump publicly defended Pruitt and praised his job performance as recently as early June.

Pruitt also endured contentious hearings recently on Capitol Hill during which he admitted little culpability as lawmakers in both parties grilled him about his ethics and spending decisions.

But the EPA leader continued to be dogged by bad publicity, as alleged spending excesses were described by current and former aides to congressional lawmakers.

The Washington Post reported that a lobbyist had helped arrange Pruitt’s $100,000 trip last December to Morocco, only to later receive a $40,000-a-month contract to promote that country’s interests.

Documents obtained under the Freedom of Information Act showed the same pattern for a visit the administrator wanted to make to Australia. That travel was canceled at the last minute, as was a trip to Israel, which had been lined up in part by casino magnate and Republican megadonor Sheldon Adelson.

The documents contained emails that showed Pruitt used his official position to line up a call with an executive at Atlanta-based Chick-fil-A, during which he raised the prospect of his wife’s getting one of the company’s coveted franchises.

Combative and unapologetic, Pruitt spoke with the rapid-fire delivery of a trial lawyer when outlining his policy positions or addressing audiences. While serving as Oklahoma’s attorney general, he made a name for himself in conservative circles by suing the EPA 14 times. And after taking over the EPA, he spent the bulk of his time meeting privately with industry leaders regulated by his agency, including top executives from the fossil fuel, agriculture and chemical sectors.

In the early months of the Trump administration, when other Cabinet members were struggling to recruit deputies and navigate their departments, Pruitt was already unraveling federal restrictions on greenhouse-gas emissions and toxic-waste discharge from coal-fired power plants. He declined to ban a commonly used pesticide linked to potential neurological damage in fetuses, as the agency had previously proposed.

And he pushed Trump to announce a U.S. withdrawal from the landmark Paris climate accord. He questioned not only the science of climate change but also the overwhelming scientific consensus that human activity is the primary contributor to global warming. He fundamentally altered the makeup of key scientific advisory boards, adding industry voices and barring scientists who had received EPA grants.

The moves, coupled with Pruitt’s penchant for secrecy, made him a lightning rod for controversy. He refused to publish his schedule in advance or to release transcripts of speeches he delivered in front of industry groups. He installed biometric locks on doors and constructed the soundproof phone booth for his use.

From his third-floor, wood-paneled suite, Pruitt largely insulated himself from career staffers, many of whom had worked to craft the policies he sought to dismantle. Meanwhile, through buyouts and a hiring freeze, he proudly shrank the EPA’s workforce to levels not seen since the 1980s.

Pruitt unrelentingly steered the agency in the direction long sought by those being regulated, a shift he defended as providing regulatory certainty, handing greater power to states and saving companies money in compliance costs.

Critics described his approach as an assault on the agency’s mission, its employees and on science. Supporters applauded his willingness to wrangle an agency many conservatives view as prone to overreach and, as Pruitt recently said, “a bastion of liberalism.”

The administrator’s fervor and stamina elevated his profile significantly. At one point, Pruitt was viewed as a contender for attorney general if the president decided to fire Jeff Sessions, and he spoke privately with others about climbing the ranks of Trump’s Cabinet.

Pruitt, who had considered running for Oklahoma governor before joining the administration, made a point of meeting with GOP activists and addressing large organizations. He delivered the keynote speech at the Conservative Political Action Conference’s annual gathering in February, a slot often reserved for presidential contenders.

When asked at CPAC what stood out as his proudest moment as head of the EPA, he cited Trump’s decision to pull the United States out of the Paris climate agreement – a decision that was a win for Pruitt over Trump’s daughter and son-in-law, Ivanka Trump and Jared Kushner.

“The president showed tremendous fortitude, tremendous courage to stand in the Rose Garden in June and say, ‘You know what? I’m going to put America first,’ ” Pruitt told the audience.

In recent months, however, Pruitt’s favor and credibility within the administration began to unravel. Even as he continued to announce far-reaching actions to scrap or scale back regulations, scrutiny of his ethics and profligate spending began to overshadow his actual policies.

In February, The Washington Post detailed Pruitt’s routine use of first-class air travel and his stays in high-end hotels on dozens of trips during his first year, which racked up hundreds of thousands of dollars in taxpayer-funded expenses. While the EPA said such travel arrangements were necessary, given the elevated number of threats to Pruitt’s security, the revelations led to a wave of criticism about his spending and inquiries from lawmakers and government investigators.

Further allegations of ethical misconduct followed.

They included news that the EPA leader’s office had circumvented the White House and used an obscure provision in the Safe Drinking Water Act to give large pay increases this spring to two top aides, staffers who had come with him from Oklahoma. In an interview with Fox News in early April, Pruitt claimed to have “corrected” the decision and said he had not been aware of the raises beforehand. Three administration officials subsequently said that Pruitt had endorsed the raises, though other staff members had overseen the paperwork.

Other accusations emerged: that the EPA had considered a roughly $100,000-a-month contract to lease a private jet for Pruitt; that Pruitt’s director of scheduling was also house-hunting for him on the side; that after leaving his Capitol Hill rental last summer, Pruitt ran the EPA from Oklahoma for a month; that he wanted his security detail to use emergency lights and sirens to get him around Washington faster, including to dinner at a favorite French restaurant; that he had upgraded to a larger, customized – and more expensive – SUV than his predecessor had used; that he reassigned or dismissed a handful of senior employees who had questioned his spending on travel, furnishings and more.

Internally, Pruitt’s inner circle fractured between aides he had recruited from his Oklahoma days and conservatives who had worked in Washington for years and fought unsuccessfully to contain the administrator’s spending excesses.

As the headlines piled up – prompting Rep. Carlos Curbelo, R-Fla., to tweet that Pruitt’s “corruption scandals are an embarrassment to the Administration” – top aides strategized about how to protect their boss’s job. Industry allies rallied to his side.

Several congressional Republicans, as well as some governors, conservative groups and pundits, defended the embattled EPA chief. Sens. Rand Paul, Ky., and Ted Cruz, Texas, publicly backed Pruitt, as did governors Matt Bevin of Kentucky, Phil Bryant of Mississippi and Pete Ricketts of Nebraska. Bevin tweeted that the administrator should “ignore the nattering nabobs of negativism,” invoking a phrase Vice President Spiro Agnew used in 1969 while blasting the media.

But as weeks passed and more allegations mounted, at least half a dozen of Pruitt’s closest aides, including several who came with him from Oklahoma, left the agency. His support on Capitol Hill eroded, and few industry representatives rushed to his defense.

Just as he has with a few other Cabinet members he eventually dismissed, Trump at first stuck up for Pruitt. “He’s been very courageous,” the president told reporters April 5 on a flight back from West Virginia. “I can tell you, at EPA, he’s done a fantastic job.”

On June 6, he praised Pruitt during a meeting at the headquarters of the Federal Emergency Management Agency. “EPA is doing really, really well. And, you know, somebody has to say that about you a little bit. You know that, Scott,” Trump said as Pruitt looked on. “People are really impressed with the job that’s being done at the EPA.”

But less than a month later, the president decided that his most controversial Cabinet member had to go.

On the night before offering his resignation, Pruitt attended a gathering for military families on the White House lawn. A band played. Families spread blankets on the grass, as fireworks exploded over the nation’s capital.