Scott Pruitt, chosen by President Donald Trump to lead the Environmental Protection Agency despite repeated lawsuits against the agency when he served as Oklahoma’s attorney general, resigned as EPA director July 5. Pruitt had been under scrutiny throughout his EPA tenure for questionable ethical decisions involving his office.

Pruitt, who repeatedly said he had done nothing wrong during his time as director, in his resignation letter Thursday wrote: “It is extremely difficult for me to cease serving you in this role first because I count it a blessing to be serving you in any capacity, but also, because of the transformative work that is occurring. However, the unrelenting attacks on me personally, my family, are unprecedented and have taken a sizable toll on all of us.”

He continued: “My desire in service to you has always been to bless you as you make important decisions for the American people. I believe you are serving as President today because of God’s providence. I believe that same providence brought me into your service. I pray as I have served you that I have blessed you and enabled you to effectively lead the American people.”

Pruitt’s EPA had moved to weaken greenhouse gas regulations for power plants, including calling for a repeal of the Obama-era Clean Power Plan, and also sought to stall measures mandating higher fuel-efficiency standards for U.S. automakers. Trump continued to support Pruitt even as calls for investigations into his dealings—including his renting a Capitol Hill room from the wife of an energy industry lobbyist for $50 a night—mounted.

Deputy Administrator Andrew Wheeler, a former lobbyist for the coal industry, will step in as EPA director until Trump nominates a successor. Wheeler has said he would recuse himself from EPA matters concerning coal, though he was involved in discussions about government actions to help the coal industry last year.

Pruitt’s spending on his security, including expenditures for air travel at taxpayers’ expense, excessive pay raises for his staff, and his decision to install a $43,000 private phone booth in his office, have all been under investigation. The EPA inspector general is currently looking into Pruitt’s housing arrangements, his protective service detail, and allegations he had EPA staff perform his personal errands. The General Accountability Office and the House Oversight Committee also have been investigating Pruitt for possible infractions.

A spokesman for the EPA inspector general told CNN that reviews of Pruitt’s conduct will continue despite his resignation. “Any ongoing or pending OIG reviews related to the Administrator and/or his team will continue—regardless of the Administrator’s resignation,” the spokesman said.

Those within the EPA said many career and political appointees to the agency were dismayed by Pruitt’s conduct as director, but said they did not think Trump would push him out or ask for his resignation. “Still in shock to be honest,” one official told CNN. “Incredible that he lasted as long as he did.”

Some within Pruitt’s own Republican Party were pleased with Pruitt’s resignation. GOP Sens. Chuck Grassley and Joni Ernst of Iowa had both chastised Pruitt for what they called his mismanagement of the EPA’s ethanol program by granting waivers to refiners.

“Administrator Pruitt’s ethical scandals and his undermining of the president’s commitment to biofuels and Midwest farmers were distracting from the agency’s otherwise strong progress to free the nation of burdensome and harmful government regulations,” Grassley said. “Fewer things are more important for government officials than maintaining public trust. Administrator Pruitt, through his own actions, lost that trust.”

Erich Pica, president of environmental advocacy group Friends of the Earth, said, “Scott Pruitt’s corruption and coziness with industry lobbyists finally caught up with him. ​​​We’re happy that Pruitt can no longer deceive Americans or destroy our environment.”

Some were disappointed in Pruitt’s resignation but praised the appointment of Wheeler as interim director.

Thomas J. Pyle, president of the American Energy Alliance, in a statement said, “In the short time Administrator Pruitt was at the EPA, he accomplished much to reorient the Agency towards environmental improvement and away from an obsessive focus on global warming. The work he started on transparency, on the Clean Power Plan, on Waters of the United States, on State authority, on the federal fuel mandate, on the ethanol mandate, and on a host of other issues will ensure that the Agency remains focused on improving the environment rather than inhibiting consumer choice or compromising prosperity. We look forward to continuing to work with Acting Administrator Wheeler to fulfill the promise of this Administration, and we are confident that his knowledge, experience, and judgment will help the Trump Administration achieve its objectives with respect to environmental and energy issues.”

Wheeler previously worked as an attorney and lobbyist at Faegre Baker Daniels. One of his clients was Murray Energy, the coal company that has pushed the Trump administration to enact policies favorable to coal. Wheeler also previously worked as a top aide to Sen. Jim Inhofe (R-Okla.), an outspoken skeptic of climate change.

Darrell Proctor is a POWER associate editor (@DarrellProctor1, @POWERmagazine).