Ontario Court Judge David Cole stayed the gun possession and assault charges against the boy because he found his charter rights were violated, but not without some stern words for both the boy and the Toronto police.
There is a "decade-long history" of strip searches by Toronto Police Service officers sometimes being found unconstitutional, Cole said, citing other decisions.
"With all due respect to the TPS (and perhaps also to the Police Services Board), it seems to me clear that unless the admittedly rather draconian remedy of a stay of proceedings is not imposed, 'state misconduct is likely to continue in the future,'" Cole said, using wording from a Supreme Court of Canada decision.
To the boy, Cole said he hopes he has learned from the experience to leave guns alone.
"They do not make you cool, they do not make you powerful, they do not make you into a tough guy," Cole said in his ruling Monday.
"Just the converse: possession of them is foolish, not only because they can get you thrown out of school or put you in jail, but more importantly because they can injure or kill you or your fellow students."
The boy, who can't be identified because of his age, was 12 when teachers found a gun and ammunition in his backpack after a fight at school, the judge heard.
At the police station, officers made the boy remove all of his clothing and they performed a visual inspection.
Proper procedure for a strip search is for the accused to remove their clothing one piece at a time so it can be examined then put back on, never leaving the accused fully naked.
Cole ruled that this strip search violated the boy's charter right to not be subjected to an unreasonable search.
In his judgment, Cole directly addressed parents of school-age children, predicting outcry for letting the boy "escape justice" on such serious charges.
"One important aspect of what comprises 'the conscience of the community' is an anticipation of how we expect the police to treat our children should they be taken to the police station for processing, even on very serious charges," Cole said.
"Leaving a 12 1/2-year-old naked in violation of expressly mandated policies prohibiting such official behaviours is not what we should expect."
The Toronto Police Services Board is currently reviewing its strip-search policies, Cole added.
Also on HuffPost