A Supreme Court of Canada ruling has made it easier for judges to deny accused people bail, at a time when the country's provincial prisons are bulging with inmates waiting for their trial.

More than half of the country's 25,000 provincial inmates have not been convicted of a crime, but are simply waiting for a bail hearing or being held until their trial. The provincial corrections system costs $1.9-billion a year.

But the court, perceived by some as soft on crime for its rejection of Conservative crime laws, said Friday that judges have been overly reluctant to deny bail when necessary to maintain public confidence in the justice system. Ruling in the case of a 22-year-old Montreal man who, with two other men, was accused of beating a bus driver in 2013, the court said unanimously that keeping him in jail until his trial was vital to preserving public confidence. News media had broadcast a videotape of the vicious beating.

Story continues below advertisement

And the court set down guidelines for future cases, telling judges that protecting public confidence by denying bail need not wait for exceptional or rare cases.

"If they make it easier to detain people, more people will be detained," Toronto lawyer John Norris, who represented the Criminal Lawyers' Association, an intervenor in the case, said in an interview.

There are three grounds for denying bail to an accused person in Canada: protecting public safety; ensuring the individual shows up for trial; and maintaining public confidence. A Justice of the Peace had rejected Jeffrey St-Cloud's request to be freed on bail, and a second judge, after Mr. St-Cloud's preliminary inquiry, also rejected his request. Both judges cited the need to maintain public confidence. But then Mr. St-Cloud appealed to a higher court and was released on bail.

Police picked Mr. St.-Cloud up Friday morning, after the ruling, and took him back to jail. He had been free for the past 20 months. His trial starts next January. "A lot of people will lose the right to be free while waiting for trial. It's a big, big change in the philosophy of criminal law in Canada," André Lapointe, a lawyer representing Mr. St-Cloud, said in an interview.

Justice Richard Wagner, who wrote the ruling, stressed the importance of giving meaning to Parliament's choice to protect public confidence. He came to Prime Minister Stephen Harper's attention as a candidate for the Supreme Court, a source said, when he wrote a 2012 ruling while on the Quebec Court of Appeal denying bail (in order to preserve public confidence) to Jacques Delisle, a former Quebec judge who was hoping to appeal his conviction for murdering his wife.

In a long explanation of who the "public" is, Justice Wagner quoted former chief justice Antonio Lamer, who referred to the "reasonable person," described as the "average person in the community, but only when that community's current mood is reasonable." He also quoted from a 1990 Quebec appeal court ruling that warned of a tendency of the public to become emotional about crime.

In the end, he said, judges must be "sensitive to the perceptions of people who are reasonable and well informed. This enables the courts to act both as watchdogs against mob justice and as guardians of public confidence in our justice system."

Story continues below advertisement

He said some judges had misinterpreted a previous Supreme Court ruling denying bail to a man who had inexplicably murdered a woman and intended to behead her. Crimes do not need to be heinous or unexplainable to put public confidence at risk. In fact, he said, any crime can qualify, and judges should consider whether it was a crime against a vulnerable person, or committed by someone who belongs to a criminal organization.

In general, he said the law requires judges to consider the strength of the prosecution's case and the seriousness and circumstances of the crime, including whether a firearm was involved.

William Trudell, chair of the Canadian Council of Criminal Defence Lawyers, said the ruling reads almost like a "defence of presumptive detention."