OTTAWA — Equating time served in the community with time spent in jail opens up the door to absurd possibilities within immigration law, the Supreme Court of Canada ruled Thursday.

In an unanimous decision, the court said conditional sentences do not count as jail time when it comes to deciding whether permanent residents convicted of a crime should lose their status in Canada.

The justices also ruled that deciding whether a permanent resident is inadmissible to Canada depends on the maximum sentence on the books at the time they committed the offence and not at the time their immigration proceedings begin.

READ MORE: Immigration Canada ‘breaking the law,’ when denying some disabled applicants, say legal experts

Thursday’s decision means the federal public safety minister must now decide anew whether Thanh Tam Tran, who came to Canada from Vietnam as a teenager decades ago, ought to have his permanent status reviewed in light of his criminal past.

Story continues below advertisement

Tran was convicted in 2012 for his role in running a marijuana grow-op. At the time of his conviction, the offence carried a maximum 14-year jail term, but he was given a 12-month conditional sentence to be served in the community.

The government began a process to revoke his permanent residency under a section of immigration law that renders a person inadmissible to Canada if they’re convicted of “serious criminality,” defined as an offence that carries a maximum 10-year penalty or a conviction that results in at least six months behind bars.

Tran took the government to court to stop the immigration proceedings.

WATCH: Pro and anti-immigration protesters face-off at Quebec border station

0:48 Pro and anti-immigration protesters face-off at Quebec border station Pro and anti-immigration protesters face-off at Quebec border station

He argued that in 2011, the year he committed the offence, the maximum penalty on the books was only seven years, and that the law at the time of his offence must be the one under which his admissibility was judged. He also argued the conditional sentence he received ought not to count as a “term of imprisonment.”

Story continues below advertisement

The Federal Court agreed with him, but the Federal Court of Appeal sided with the government.

The top court overruled that decision, with Justice Suzanne Cote writing that equating conditional sentences to a “term of imprisonment” opens the door to absurd possibilities in the context of immigration law.

The Immigration and Refugee Protection Act makes it clear that the length of a sentence is a sign of whether a crime is serious, which is why they set a six month bar, but not all sentences are the same, Cote wrote.

WATCH: Family in ‘shock’ after permanent residency denied by Immigration Canada due to daughter’s disability

Previous rulings have determined that conditional sentences were for “less serious and non-dangerous” offenders.

“It would be an absurd outcome, if, for example, ‘less serious and non-dangerous offenders’ sentenced to seven-month conditional sentences were deported, while more serious offenders receiving six-month jail terms were permitted to remain in Canada,” Cote wrote.

“Public safety, as an objective of (immigration law) is not enhanced by deporting less culpable offenders, while allowing more culpable persons to remain in Canada.”

Ensuring public safety also means permanent residents must fully understand what it means to behave lawfully while in Canada, the court said.

Story continues below advertisement

WATCH: Federal NDP slap Liberals for failing to repeal ‘discriminatory’ immigration policy

1:35 Federal NDP slap Liberals for failing to repeal ‘discriminatory’ immigration policy Federal NDP slap Liberals for failing to repeal ‘discriminatory’ immigration policy

The government had argued what that means is Parliament’s view of the seriousness of an offence at the time of admissibility proceedings, but Cote did not agree.

Tran could not have known when he committed his crime that what he was doing was an act of serious criminality that might breach those obligations and lead to his deportation, Cote wrote.

“While Parliament is entitled to change its views on the seriousness of a crime, it is not entitled to alter the mutual obligations between permanent residents and Canadian society without doing so clearly and unambiguously,” she wrote.

“…The right to remain in Canada is conditional, but it is conditional on complying with knowable obligations.”

Story continues below advertisement