Canada's top court on Thursday dismissed, with costs, the case of a twice-convicted Ottawa man who was born in Canada but was never granted Canadian citizenship.

Under Canadian law, citizenship by birth doesn't apply to people whose parents were in Canada as diplomats or representatives of a foreign government, or whose parents were employed by such a person, at the time of their birth.

When Deepan Budlakoti was born in Ottawa in 1989, his parents were both Indian nationals working for the Indian High Commission.

In 1992, Budlakoti's parents were granted permanent resident status. They applied for citizenship for themselves but not for their son. Their application was accepted.

Convicted of weapons and drug trafficking

According to court documents, Budlakoti was convicted in 2009 of breaking and entering and sentenced to four months in jail. He was considered a permanent resident of Canada at that time.

Deepan Budlakoti was born in Ottawa but under Canadian law, citizenship by birth doesn't apply to people whose parents were in Canada as diplomats or representatives of a foreign government, or whose parents were employed by such a person at the time of their birth. (Thomas Daigle/CBC)

In 2010, he was convicted of weapons trafficking, possession of a firearm and drug trafficking and was sentenced to three years in jail.

The Minister of Citizenship and Immigration's office launched an investigation into Budlakoti's status in Canada in 2011.

The investigation found he was a permanent resident, not a Canadian citizen, and therefore inadmissible to Canada because of the "serious criminality" involved in his offences.

Not recognized by India

When his sentence was complete, Budlakoti was transferred to the Canada Border Services Agency, where he was to be detained pending his removal from Canada. In 2013, India's High Commission said it didn't recognize Budlakoti.

He was later released from CBSA custody with certain conditions, including that he not leave the Ottawa area and check in with the agency regularly. Some of those conditions were later eased.

Budlakoti took his citizenship fight to Federal Court, arguing that the government infringed on his Charter rights to life, liberty and security of the person.

Budlakoti also disputed his parents' employment status at the time of his birth, arguing they had stopped working for the High Commission two months before he was born, and they were not diplomats.

The Federal Court ruled against him in September 2014, and the Federal Court of Appeal upheld the ruling in June 2015.

'I made a mistake ... but I paid my debt'

Since being freed from detention in 2013, Budlakoti has received support from human rights organizations, public-sector unions and members of the public who say his legal limbo is unfair and violates his freedoms.

He collects donations from the public and unions and says his legal team either works for free or at reduced rates.

Budlakoti says he made mistakes when he was younger but is rehabilitated.

"I was a ward of the state when I was 14," he told the Canadian Press in July 2015. "I was going from group home to group home. I made a mistake when I was younger but I paid my debt to society and I'm trying to move on with my life."

Budlakoti filed an appeal to the Supreme Court of Canada in September 2015 and it was dismissed with costs on Thursday.