Image copyright Press Association

A Canadian young man whose home was raided by 15 police officers after he downloaded government documents has been cleared.

Nova Scotia police opted not to lay charges this week against the unnamed 19-year-old after a loud public outcry.

The young man says he was just trying to download public information, but a security glitch gave him access to hundreds of people's personal data.

His arrest provoked backlash from those who say the government overreacted.

On 11 April, 15 police officers raided the home he shares with his parents and siblings, confiscated the household electronics and arrested him, he told the CBC.

"They rifled through everything. They turned over mattresses, they took drawers and emptied out drawers, they went through personal papers, pictures," his mother told the CBC in an interview. "It was totally devastating and traumatic."

His alleged crime?

Downloading about 7,000 public documents. The man, an avid online archivist and proponent of government transparency, was researching a labour dispute between the province and teachers in hopes of collecting access-to-information requests, which by law are posted online.

Instead of downloading files one by one, he wrote a piece of code that would mass download all files classified as public access-to-information requests. The problem was that some of the files had been misclassified, exposing about 700 people's private information.

"I didn't do anything to try to hide myself. I didn't think any of this would be wrong if it's all public information. Since it was public, I thought it was free to just download, to save," he told the CBC.

He was charged with "unauthorised use of a computer" and faced a possible 10-year prison sentence.

Meanwhile, Nova Scotia Premier Stephen McNeil accused him of "stealing" the documents.

That harsh language, and the raid, angered many, who said the young man was being made into a scapegoat for the government's own incompetence.

A GoFundMe was launched to help raise money to cover the cost of his defence, and has since earned more than $11,725 (C$15,000; £8,700).

"Obviously, this was something that's particularly embarrassing to the provincial government and I can imagine that there is a fair amount of pressure to find a scapegoat, point the finger and press some charges," David Fraser, the privacy lawyer representing the teen, told the CBC.

On 7 May, the police said they would drop all charges.

"This was a high-profile case that potentially impacted many Nova Scotians," said police superintendent Jim Perrin.

"We have determined that the 19-year-old who was arrested on April 11 did not have intent to commit a criminal offence by accessing the information."

The privacy breach, which was discovered by a government employee, forced the government to shut down its freedom-of-information portal, which as of Friday remained offline.