WASHINGTON — Scott Pruitt’s concern with his safety came at a steep cost to taxpayers as his swollen security detail blew through overtime budgets and at times diverted officers away from investigating environmental crimes to protect him.

Altogether, the agency spent millions of dollars for a 20-member full-time security detail that is three times the size of his predecessor’s part-time security contingent.

New details in Pruitt’s expansive spending for security and travel emerged from agency sources and documents reviewed by The Associated Press.

Shortly after arriving in Washington, Pruitt demoted the career staff member heading his security detail and replaced him with EPA Senior Special Agent Pasquale “Nino” Perrotta, a former Secret Service agent who operates a private security company. An EPA official with direct knowledge of Pruitt’s security spending said Perrotta oversaw a rapid expansion of the EPA chief’s security detail to accommodate guarding him day and night, even on family vacations and when Pruitt was home in Oklahoma.

The EPA official spoke on condition of anonymity for fear of retaliation.

Perrotta also signed off on new procedures that let Pruitt fly first-class on commercial airliners, with the security chief typically sitting next to him with other security staff farther back in the plane. Pruitt’s premium status gave him and his security chief access to VIP airport lounges.

The EPA official said there are legitimate concerns about Pruitt’s safety, given public opposition to his rollbacks of anti-pollution measures.

But Pruitt’s ambitious domestic and international travel led to rapidly escalating costs, with the security detail racking up so much overtime that many hit annual salary caps of about $160,000. The demands of providing 24-hour coverage even meant taking some investigators away from field work, such as when Pruitt traveled to California for a family vacation.

The EPA official said total security costs approached $3 million when pay is added to travel expenses.

Pruitt has come under intense scrutiny for ethics issues and outsized spending. Among the concerns: massive raises for two of his closest aides and his rental of a Capitol Hill condo tied to a lobbyist who represents fossil fuel clients.

At least three congressional Republicans and a chorus of Democrats have called for Pruitt’s ouster. But President Trump is so far standing by him.

A review of Pruitt’s ethical conduct by White House officials is underway, adding to probes by congressional oversight committees and the EPA’s inspector general.