The Australian government has cancelled the visa of a 51-year-old North Korean man who has spent over 20 years in Australia.

Two applications to overturn the cancellation have been rejected, and now the man, who is in immigration detention, is taking his fight to the Federal Court of Australia.

The man, known only as DKXY, says he fled North Korea in 1987 after speaking out against the government of Kim Il-sung, the grandfather of current Supreme Leader Kim Jong-un. When his brother warned him that the authorities were after him, he made his way to China through the mountains in the north.

"He never got to say goodbye to his parents, he never got to say goodbye to his brother," his barrister Jason Donnelly told BuzzFeed News. "He doesn't know what happened to them at all."

The man lived in China for the next six years, before leaving to avoid being sent back to North Korea. China routinely labels North Koreans "economic migrants" and returns them.

He made his way onto a cargo boat to North Queensland, before travelling down to Sydney and finding work as a kitchen hand and chef in restaurants in Chinatown. He was granted a temporary protection visa and then eventually a permanent visa, and he's now spent half his life in Australia.

The man committed minor driving offences in 2004 and 2007, and was convicted of supplying prohibited drugs in 2008. In 2009, he was formally warned that future offending could affect his residence in Australia. In 2015, the man was sentenced to six years in prison for supplying 385gms of methamphetamine, or ice.

In 2017 his visa was cancelled while he was serving the prison sentence for supplying drugs.

Since 2014, any non-citizen sentenced to prison for 12 months or longer has their visa automatically cancelled. However the immigration minister has a discretionary power to reinstate the visa.

The man applied to have his visa reinstated, but in July a delegate of home affairs minister Peter Dutton rejected the application.

The man went to the Administrative Appeals Tribunal (AAT) to fight the decision, but he lost the case.

The AAT found that the risk of significant hardship to the man if he were deported to North Korea was outweighed by the interest in protecting the Australian community, and community expectations that he shouldn't be able to stay in the country.

The man argued that if returned to North Korea he would face harm, and might be sent to a prison camp or even executed. He also that his offending was due to a drug habit that he had overcome.

According to Human Rights Watch, North Korea considers leaving the country without official permission to be a serious crime, frequently punished by imprisonment, forced labour, physical abuse, and in some cases death.

Australia's Department of Foreign Affairs and Trade says it has "grave concerns over serious human rights violations" in North Korea, and that the regime uses "extensive torture, public executions, collective punishment ... and the extensive use of forced labour camps with abhorrent conditions."

Pool / Getty Images

However, the tribunal was sceptical of the man's claims that he would be harmed if returned, saying there was insufficient evidence that Australia owed him protection obligations, or that he would be of interest to North Korean authorities.

The tribunal member described his claims about fear of harm as "minimal", and complained that his story about how he came to depart North Korea over 30 years was not supported by independent documentary evidence.

Nonetheless, the tribunal decided to give the man the benefit of the doubt and assume there was a risk that he would be harmed if returned to North Korea. It found that was a "strong reason" in favour of reinstating the visa. The judgement also considered that even if the government decided it couldn't deport him, he would face indefinite detention in Australia's immigration detention centres for a "very lengthy" period of time.

Overall, the tribunal found that his offences were serious, that there was a risk that he would re-offend, and that the Australian community would think he had already been given a "fair go", and that these factors weighed against his visa being reinstated.

"The tribunal has formed the view that the protection of the Australian community and community expectations outweigh other considerations," the tribunal member concluded.

Now the man is appealing the decision in the Federal Court.

He filed his application for the court to review the AAT's decision last week. He'll be arguing that the AAT's decision was wrong, including that it was unreasonable not to find that North Korean defectors should automatically be considered to be refugees. Donnelly expects it to be heard next year.

If the man loses his appeal, he will be able to apply for a three-year temporary protection visa or a five-year safe haven visa. However, his lawyer argued in the tribunal that the same "character" considerations that led to his visa being cancelled will mean his future visa applications are rejected. As well, given the AAT found initially that he did not have a strong protection claim, there is a risk that the decision-maker on a future visa application would come to the same conclusion.

If that happens, the man will likely face two potential outcomes: being sent back to North Korea, or being indefinitely detained in immigration detention.

BuzzFeed News has approached the Department of Home Affairs for comment.