Federal prosecutors said Monday that a software engineer on trial for the largest leak of classified information in CIA history was “prepared to do anything” to betray the agency.

Joshua Schulte is a former CIA coder accused of sending the anti-secrecy group WikiLeaks a large portion of the agency’s computer hacking arsenal — tools the agency had used to conduct espionage operations overseas.

“The defendant was prepared to burn down the United States government,” Assistant U.S. Attorney Matthew Laroche said. “He is an angry and vindictive man.”

OREGON WIDEROWER, 80, SCAMMED OUT OF $200G IN ONLINE DATING SCAM, OFFICIALS WARN: 'DON'T GET CATFISHED'

His defense attorney argued the man had been scapegoated for a breach that exposed secret cyberweapons and spying techniques.

Prosecutors have said the leak was devastating to national security, as it exposed CIA operatives, brought intelligence gathering to a halt and left allies wondering whether the U.S. could be trusted with sensitive information.

Schulte left a trail of evidence despite learned attempts to erase his digital fingerprints, Laroche said in closing arguments. Schulte became disgruntled at the CIA, he said, and took meticulous steps to plan — and cover up — the 2016 theft.

“He was the only one who had the motive, the means and the opportunity to steal the information,” Laroche said. “He was prepared to do anything to get back at the CIA.”

A Manhattan jury heard conflicting portrayals of Joshua Schulte, a former CIA coder accused of sending the anti-secrecy group WikiLeaks a large portion of the agency’s computer hacking arsenal — tools the agency had used to conduct espionage operations overseas. (U.S. District Court Southern District of New York)

A Manhattan jury heard conflicting portrayals of Joshua Schulte, a former CIA coder accused of sending the anti-secrecy group WikiLeaks a large portion of the agency’s computer hacking arsenal — tools the agency had used to conduct espionage operations overseas. (U.S. District Court Southern District of New York)

Defense attorney Sabrina Shroff called Schulte a patriot who was wrongly accused by an agency under intense pressure to solve the embarrassing leak. She said the four-week trial raised more questions than it answered and exposed alarming security lapses within the agency.

“The government cannot tell you which of the many people with access to this data” stole the classified archive, she said. “It wasn’t Mr. Schulte who did this.”

Schulte, 31, worked for a CIA group in Langley, Va., that designs computer code to spy on foreign adversaries. The so-called Vault 7 leak revealed how the CIA would hack Apple and Android cellphones in overseas spying operations.

The government settled too hastily on Schulte as the leaker, Shroff said, ignoring suspicious activity by one of his colleagues who was ultimately suspended. The prosecution's theory has “giant holes,” she said, including the unresolved question of why WikiLeaks waited nearly a year to publish the archive.

The data was stolen from a CIA network that was so insecure — one witness called it “the wild Wild West” — that investigators could not trace the leak with any certainty, she said.

CLICK HERE FOR THE FOX NEWS APP

But prosecutors said a sequence of subterfuge implicated Schulte, including deleting computer logs from his CIA work station and restoring administrator privileges from which the agency had stripped him. He made dozens of searches for WikiLeaks in the ensuing months and became “obsessed” with whether his leak had been published, prosecutors said.

Schulte also is accused of trying to leak secrets after his arrest by using a contraband cellphone in the federal lockup where he is being held and creating encrypted email and secret social media accounts.

The Associated Press contributed to this report.