Two members of Anonymous at a demonstration in London, 2008.
Two members of Anonymous at a demonstration in London, 2008.

A 12-year boy Canadian boy has pleaded guilty to hacking government websites, causing thousands of dollars in damage and selling stolen information to the cyber activist collective Anonymous in exchange for computer games.

The fifth grade student, from the Montreal suburb of Notre-Dame-de-Grâce, appeared in court last week wearing his school uniform and accompanied by his father, accused of committing a sophisticated series of cyber-attacks on Montreal police, the Quebec Institute of Public Health and the Chilean government.

The attacks all took place in 2012, during the Quebec student riots, where thousands took to the streets to protest against a hike in tuition fees, and clashes between demonstrators and police left many seriously injured.

In 2006, the Chilean government used force against student protesters.

The boy, who cannot be named for legal reasons, pleaded guilty.

He used three methods in his cyber-attacks, including distributed denial of service (DDoS) attacks, in which a server is bombarded with simultaneous requests, disabling it.

The attacks took sites offline for two days, with damages estimated at $60,000, said police.

He was not politically motivated, said his lawyer, but swapped information he stole from targeted organisations with the hacktivist group Anonymous for video games.

"He saw it as a challenge, he was only 12 years old," said the young hacker's lawyer. "There was no political purpose."

According to Montreal police, they boy , who became seriously interested in computers when he was nine, "opened the door" for other hackers arrested, teaching them how to commit their own cyber-attacks.

Police said more details of the offences would be revealed next month, when the 12-year-old is sentenced.

Anonymous began a cyber-campaign in the city to hack government sites after an emergency law was introduced, limiting demonstrations in an attempt to suppress the mass unrest.

In an attempt to disrupt the region's economy, Anonymous hacked the Formula One website, and sent emails those who had bought tickets to the Montreal Grand Prix, warning them not to attend.

They also released a private video they had accessed, showing influential guests, including former US president George Bush snr, at a party for the wealthy Desmarais family, to expose their political influence.

Earlier this year, a 20-year-old student from Montreal, Ahmed Al-Khabaz, was expelled after hacking the Dawson College website.

As soon as he left, he received a job offer from the software company that ran the site.