Troy Millington, a former candidate for the leadership of the Alberta Party, has been found guilty of child pornography offences.

A jury convicted Millington on all three counts he faced. The verdict was returned shortly after midnight Friday, after several hours of deliberation late Thursday night.

Police found thousands of images and videos of child pornography on Millington's home computer equipment.

Troy Millington has been convicted of child pornography offences. (Campaign photo)

Testifying in his own defence, Millington told the court he was trying to rid the world of child porn by creating an algorithm or program that could prevent the spread of such images online.

Millington ran, unsuccessfully, for the leadership of the Alberta Party in 2013.

He represented the Alberta Party as a candidate in the 2014 byelection in Calgary-West, placing fifth out of five candidates, with 2.4 per cent of the vote.