SUDBURY -- Child porn charges against Sudbury doctor Ian MacDonald have been withdrawn, officials at the Sudbury Courthouse confirmed Friday.

MacDonald had been charged with seven counts of accessing child pornography between 2016 and 2019. But a recent court ruling was a major blow to the case.

Ontario Court Justice Heather Mendes ruled Sept. 26 that four of five search warrants issued during the investigation were invalid because they were improperly filled out. Mendes ruled the error on the warrants could not be altered to make them compliant with the law, as Crown Attorney Stephanie Baker argued.

"We need to decide how we are going to proceed," Baker told Mendes, in asking for some time to reassess the Crown's approach in light of the ruling.

The charges were formally withdrawn Oct. 7.

In a July hearing, defence lawyer Michael Lacy argued four of the five warrants issued in the case were invalid because the wrong box was checked on the form. Rather than checking the box that said they were investigating an offence that was committed, they checked the box that said suspected to have been committed.

"It may appear to be a minor problem, but it is significant," Lacy said in July.

It's significant because previous judgments have said warrants for suspected offences can only be issued for where the offence is suspected to have taken place – in this case, Health Sciences North. Broader warrants for other locations can only be issued once police know an offence has been committed.

Mendes agreed in the Sept. 26 ruling, and the Crown made its decision to drop the case.

It also emerged in July that the Greater Sudbury Police officer who investigated the case had a practice of asking child porn suspects for the password to their computer, something the defence argued is unconstitutional. In response, Baker said they wouldn't be relying on information gained from the password even before the ruling on the warrants was issued.

The Crown is now reviewing 13 other child porn cases the investigating officer had handled in which a similar practice was employed.

Lacy told CTV in a statement Friday that the court ruled "various warrants obtained by the police were facially invalid and which also permitted the defence to cross-examine the investigating officer on another search warrant he obtained."

"Had the trial proceeded, we were confident Dr. MacDonald would have been vindicated," Lacy said in the statement. "The withdrawal by the Crown also speaks to that vindication as the Crown concluded in light of the ruling, there was no longer a reasonable prospect of conviction."

Since the charges were withdrawn, he said allegations of other "constitutional violations committed by members of the Sudbury Regional Police Service … were never fully litigated. I cannot speak to what impact, if any, the case will have on any other prosecution."