EPA Administrator Scott Pruitt joined President Trump last June for the administration’s announcement that the United States would pull out of the Paris climate accord. (Jabin Botsford/The Washington Post)

In the run-up to the decision to pull out of the Paris climate agreement last May, President Trump wanted the opinion of Environmental Protection Agency Administrator Scott Pruitt. But when the president’s personal secretary called the EPA, Pruitt wasn’t around.

As it turned out, he was already in the White House, having just ordered the ice cream special in the Mess, where he often dined hoping for just such an opportunity to talk to the president. Once in the Oval Office, Pruitt reinforced Trump’s desire to leave the accord, arguing against other advisers so long that an aide had to bring a cup so his melting ice cream wouldn’t drip onto the presidential rug.

Pruitt’s actions that May day are emblematic of how he has built his relationship with Trump — ingratiating himself personally, extolling the president’s abilities and strongly backing him on policy in meetings and in regular one-on-one conversations. That approach also helps explain how the former Oklahoma attorney general has kept his job amid a bevy of transgressions that are similar to, or worse than, those that have cost other Cabinet officials their positions.

On climate change, Pruitt shares Trump’s skepticism of mainstream science and has offered a reality-TV-style way to make their case: a televised show in which Pruitt would debate a climate scientist. In an effort to support Trump’s trade stance, he devised a plan to impose stricter fuel-efficiency standards on vehicles made by foreign automakers, even though White House lawyers argued it was illegal. And he has suggested he could take a leading role in renegotiating the North American Free Trade Agreement, on the grounds that he could strike a better deal with Mexico than the president’s current advisers.

“The president’s instincts are completely right,” Pruitt frequently remarks in meetings with Trump, according to a former administration official. When Pruitt addresses groups in the Rachel Carson Room — the ornate green room in the administrator’s suite named for the famed environmentalist — he has said more than once, “I really admire the man who owns the hotel across the street.” The room overlooks the Trump International Hotel.

Trump has returned Pruitt’s loyalty with his own, resisting growing pressure from White House aides and other Republicans to get rid of him. Asked about Pruitt during a Friday morning news conference, Trump said he was “not happy about certain things, but he’s done a fantastic job running the EPA, which is very overriding.”

This story is based on interviews with nearly a dozen current and former administration officials, who spoke on the condition of anonymity to candidly discuss Pruitt’s relationship with the president. White House officials, as well as those at the EPA, declined to comment.

Pruitt faces a dozen ongoing probes into his spending and management decisions, and the Government Accountability Office already has concluded that he violated federal spending law by installing a $43,000 soundproof booth in his office without consulting Congress. Office of Management and Budget officials have determined it also violated the anti-deficiencies act in an administration review, though their findings have not been publicly released.

Among other issues, he has come under criticism for paying $50 a night to live in a condo co-owned by the wife of an energy lobbyist; taking private jets, military planes or flying first-class when he travels; allowing large raises for aides over the objections of White House officials; directing drivers to use lights and sirens when he moves around Washington; racking up steep bills on overseas trips; trying to use his position to help his wife obtain a Chick-fil-A franchise and, later, asking a top aide to contact Republican donors to help her get a job.

On Friday, the U.S. Office of Government Ethics sent a letter to the EPA’s Office of Inspector General asking it to expand its review of Pruitt’s conduct based on recent media reports and issue findings “as soon as possible” so that the ethics office can decide whether it needs to take independent action.

Though Trump appears to be sticking with the administrator for now, Pruitt’s support among other Republicans started to fray in recent days, Sen. James M. Inhofe (R-Okla.), one of Pruitt’s original backers and a longtime friend, suggested he may need to resign, while the conservative National Review said “he should be replaced,” and Fox News host Laura ­Ingraham said he’s “gotta go.”

Over the past year, Trump has removed members of his Cabinet for far fewer and less serious infractions. Health and Human Services Secretary Tom Price resigned last year because of a furor over several costly chartered and military flights he had taken. Veterans Affairs Secretary David Shulkin lost his job after his department’s inspector general concluded he and his staff misled federal ethics officials and the public about aspects of an official trip he took to Europe with his wife.

In the case of both Price and Shulkin, however, Trump had become frustrated with their inability to achieve some of his top priorities. Pruitt, on the other hand, has doggedly pursued the president’s objectives while heaping praise on the commander in chief. He has also commiserated privately with him about two of Trump’s favored grievances: the probe into Russia’s efforts to influence the 2016 election and the problem of aides who leak.

After a one-on-one call and private meeting with Trump last year in which the two men discussed how foreign automakers were undercutting U.S. firms, for example, Pruitt came up with the plan requiring stricter fuel-efficiency standards on foreign cars than domestic ones, several people familiar with the discussions said.

White House aides argued that it violated trade law and would damage the president politically, and they were annoyed that Pruitt came up with it without consulting the Transportation Department or the U.S. Trade Representative. Even Pruitt’s own advisers were dubious about the proposal, which they thought was the kind of thing he would have howled about if done under another administration.

Gary Cohn, who directed the White House National Economic Council at the time, brought lawyers in to tell the president that the plan was illegal, two officials said. The idea has been shelved for now, though Trump continues to praise it as a way to fight back against what he sees as unfair trade practices.

Pruitt has come back with more specific proposals, suggesting this spring to factor in the carbon emitted while vehicles were being built abroad and shipped to the United States — the kind of “life cycle” analysis usually espoused by left-leaning environmental groups.

Pruitt advocated for the televised debate to challenge the idea that human activity is driving climate change, a favored topic for the two men despite a definitive federal report in November that concluded there is “no convincing alternative explanation.” According to one person, Pruitt told Trump, “We can show that most scientists don’t even believe in global warming.” Trump liked the idea, but the debate was scuttled by Chief of Staff John F. Kelly, according to several officials involved in the discussions. Trump continues to appreciate that Pruitt shares his skepticism.

At one point during the weeks-long discussions about whether to exit the Paris accord, Pruitt sought to circumvent the decision-making process in a meeting with the president. Without consulting others, he gave Trump a plan to pull out of the deal, even as discussions were underway among other senior officials. Cohn and then-Secretary of State Rex Tillerson said Pruitt gave the president inaccurate data to support his argument, and he was widely excoriated for doing it secretly.

“It was total bulls---,” one person present for the discussions said.

But Trump sided with Pruitt, and one of the most notable lines in his announcement speech came from his EPA chief: “I was elected to represent the citizens of Pittsburgh, not Paris.”

Pruitt has not limited his advocacy to EPA matters. During a discussion in the Oval Office last year, the administrator voiced support for Trump’s idea that the United States needed to adopt a tougher line with Mexico when it came to renegotiating NAFTA. Pruitt made the case that he should help lead the talks because the accord includes a chapter on the environment, several officials said. Trump appreciated his enthusiasm and said Pruitt might do better than his own trade team, officials recounted. 

Shortly afterward, Pruitt called U.S. Trade Representative Robert E. Lighthizer and asked when he should be prepared to travel to Mexico to participate in the ongoing talks. Lighthizer made it clear that Pruitt’s help wasn’t needed. At another point in 2017, Pruitt promised Trump that he could help on his stalled infrastructure bill and was invited to a meeting on the topic, surprising other senior officials.

At times, some current and former administration officials said, Pruitt’s frequent presence in the West Wing resembles the HBO sitcom “Veep,” in which the vice president keeps trying to draw the president’s attention. Pruitt has dined often at the White House Mess, which allows him to buy discount meals and offers him the chance to wander the West Wing. Sometimes, he tells people to let the president know he is in the building, or he calls Trump’s personal aides on their cellphones so he can speak directly to the president.

On one occasion, according to multiple administration officials, he sat down with a group at a table reserved for White House staffers despite being told there wasn’t room for him in the small eating area.

Many White House officials, including Kelly, have urged Trump to fire Pruitt, with several saying they have been appalled at his conduct. Pruitt has stopped returning calls from many White House staffers, fearing they are out to get him.

He continues to travel the country and heap praise on the man who appointed him. Asked earlier this month by Idaho talk radio host Kevin Miller what it’s like to serve under Trump, Pruitt described it as “very empowering.”

“And what I love about the president’s leadership is, he’s about results,” the EPA chief added. “I believe he’s in the White House for two primary reasons today. One, he’s a man of courage. And two, he’s a man of action. And I think the American people want both.”

Pruitt rarely misses a chance to remind his boss about his own efforts to deliver results, namely by dismantling a slew of Obama-era environmental regulations. On Thursday, he tweeted that he had managed to roll back the previous administration’s efforts to extend federal jurisdiction over 60 percent of the nation’s water bodies. Ranchers, farm groups and developers have been staunch critics of the 2015 rule, known as Waters of the United States.

“Time to provide farmers & ranchers nationwide w/ regulatory certainty!” Pruitt tweeted, along with a photo of himself signing a document with the president by his side in the Oval Office. “Happy birthday, Mr. President!”

It is a rare picture where Trump is standing and someone else is sitting behind the Resolute Desk.