TORONTO -- A former top political aide in Ontario has been found guilty of illegally destroying documents related to a controversial government decision to cancel two gas plants before a provincial election.

David Livingston, who was chief of staff for ex-Liberal premier Dalton McGuinty, was charged with attempted mischief and illegal use of a computer. The destroyed documents were related to the Ontario Liberal government's costly decision to cancel two gas plants in 2011.

Livingston's deputy, Laura Miller, was also charged in the case and was found not guilty.

Judge Timothy Lipson, who presided over the case, said Livingston was a sophisticated individual who knew exactly what he was doing.

Lipson also said the political context around Livingston's actions was highly relevant. That context was the growing pressure in 2012 and early 2013 for the Liberal government to account for the cancellation of the two plants.

"No issues were more challenging or more dangerous to the minority Liberal government than those related to the gas plants controversy," Lipson said. "This was the grim political backdrop."

Livingston was openly dismissive of stern warnings and advice about his obligations to retain and produce gas-plant records a legislative committee had been demanding as it sought a contempt finding against the then-minister of energy, Lipson said.

It defies common sense and reality, Lipson said, to suggest that wholesale wiping of 20 hard drives in the outgoing premier's office was in accordance with policy.

While he was advised about retaining records, Lipson said, Livingston was "more interested in deleting them."

The fact that Livingston failed to warn the cabinet secretary that the wiping of 20 hard drives would be "indiscriminate" was even more serious than hiring Miller's spouse, Peter Faist ­-- who had no security clearance -- to do the job.

"(Livingston) could not have honestly believed that he had the secretary's authorization to do what he did," Lipson said.

Lipson said, however, that he could not conclude beyond a reasonable doubt that Miller knew Livingston had "fraudulently" obtained permission to access the drives, what records they had been warned to keep, and why it was so inappropriate to hire her spouse to do the wiping.

As a result, the judge said, it was possible she was unaware of the illegalities perpetrated by her boss, even though she was intimately aware of the political context in which the wiping was happening.

Lipson's decision comes just months before McGuinty's successor, Premier Kathleen Wynne, faces voters in what is expected to be a closely fought general election and the opposition were quick to pounce.

"It's a sad day when a premier's most senior official is found guilty of trying to orchestrate a cover-up of the $1.1 billion gas plant scandal," Conservative Leader Patrick Brown said in a statement. "The guilty verdict is an indictment of the 15 years of Liberal political corruption that has long been rooted in the premier's office."

The Crown had earlier dropped a charge of breach of trust against Livingston and Miller.