A U.S. judge on Tuesday threw out an obstruction charge but mostly upheld the conviction of a former Central Intelligence Agency software engineer for carrying out the largest theft of classified information in the agency's history.

Joshua Schulte, 34, was convicted in July 2022 on four counts each of espionage and computer hacking and one count of lying to FBI agents, after giving classified materials to WikiLeaks in the so-called Vault 7 leak.

WikiLeaks in March 2017 began publishing the materials, which concerned how the CIA surveilled foreign governments, alleged terrorists and others by compromising their electronics and computer networks.

Following the conviction, U.S. Attorney Damian Williams in Manhattan called the theft "one of the most brazen and damaging acts of espionage in American history."

Central Intelligence Agency

Central Intelligence Agency logo in lobby of the CIA headquarters (Reuters)

CHINA DETAINS MILITARY INDUSTRIAL WORKER ACCUSED OF ESPIONAGE FOR CIA

In a 14-page decision, U.S. District Judge Jesse Furman in Manhattan found "more than sufficient" evidence to support Schulte's espionage and hacking convictions.

But he said Schulte's alleged lies to the FBI agents did not support the obstruction charge.

The judge found "no meaningful distinction" between Schulte's case and a 1995 Supreme Court decision, U.S. v. Aguilar, reaching the same conclusion.

"At best," Furman wrote, "the government proved that Schulte, knowing of the existence of a federal grand jury investigation, lied to federal investigators regarding issues pertinent to the grand jury's investigation. Under Aguilar, that does not suffice."

PUTIN BIDING TIME FOR REVENGE ON MERCENARY WARLORD, CIA CHIEF SAYS: 'ULTIMATE APOSTLE OF PAYBACK'

Schulte represented himself at trial and in seeking to overturn his conviction. An earlier trial ended in a mistrial when jurors deadlocked.

Prosecutors have said Schulte was motivated to leak materials out of spite over how he thought the CIA treated him prior to his November 2016 resignation.

Schulte is being jailed at Brooklyn's Metropolitan Detention Center.

He faces a second trial beginning on Sept. 11 for allegedly receiving more than 10,000 images and videos of child pornography.

Prosecutors said they found the material in Schulte's Manhattan apartment, in an encrypted container beneath three layers of password protection, during the CIA leaks probe.

CLICK HERE TO GET THE FOX NEWS APP

A lawyer representing Schulte in that case did not immediately respond to requests for comment. Williams' office declined to comment.

The case is U.S. v. Schulte, U.S. District Court, Southern District of New York, No. 17-cr-00548.