The highest-paid official of the US Environmental Protection Agency bilked the government out of nearly $1 million in fraudulent wages and benefits – by convincing his bosses he was also a CIA operative and leaving for long periods at a time, authorities said.

John C. Beale, who retired in April after his phony spy career began to unravel, will be sentenced in federal court in Washington in what prosecutors said was one of the most audacious government frauds ever committed.

Beale, who served as a senior policy adviser and was a leading authority on climate change, got away with not doing his job for months at a time by telling his bosses he was off on a CIA mission, often in Pakistan or at the agency’s headquarters in Virginia.

Although he was paid more than $200,000 in salary and benefits, Beale didn’t show up for work at the EPA for six months in 2008, telling officials he was working on a massive government project involving “candidate security.”

He also billed the government for first-class airplane trips to London where he stayed at five-star hotels.

Beale’s attorney, John Kern, said in court papers that thanks to “the help of his therapist” Beale “has come to recognize that, beyond the motive of greed, his theft and deception were motivated by a highly destructive and dysfunctional need to engage in excessively reckless, risky behavior.”

Kern acknowledged there was an 18-month period beginning in June 2011 when Beale performed “absolutely no work.”

Beale, who had never been to CIA headquarters, told his superiors at one point that he had to rush off to Pakistan because the Taliban was torturing the CIA officer who had replaced him in one assignment.

Beale pleaded guilty in September to scamming the government out of $900,000 since 2000. Prosecutors are seeking a jail term of at least 30 months when he is sentenced on Wednesday.