A Federal Court judge has slammed the “disgraceful” conduct of the Immigration Minister for refusing to release from detention an Afghan refugee who had been granted a protection visa.

The case relates to an Afghan refugee of Hazara ethnicity who arrived in Australia in 2012 and applied for a Safe Haven Enterprise refugee protection visa in 2016.

The refugee is known in court documents only by the pseudonym 'PDWL'.

PDWL was refused a protection visa after failing to meet the character test requirements under the Immigration Act due to an earlier criminal conviction. But on 11 March 2020, the Administrative Appeals Tribunal overturned the department’s decision and granted him with the protection visa.

READ MORE Strict character test used to deport thousands from Australia doesn’t apply to refugees, court rules

Immigration Minister David Coleman then appealed that decision to the Federal Court, but instead of releasing PDWL - as they were legally obliged to do - the government continued to hold him in immigration detention.

In a 24-page judgment, Federal Court Judge Michael Andrew Wigney said the Minister should have released PDWL as soon as he was granted a visa.

"The conduct of the Minister in this case, on just about any view, has been disgraceful," Judge Wigney said in the judgment.

At a Federal Court hearing on 12 March, the Minister said they were in the process of releasing PDWL but in the days following, he continued to remain in detention.

"The Minister appears to have willingly and flagrantly failed to comply with the orders made," Judge Wigney said.

PDWL was subsequently released from detention on 17 March after a second Federal Court hearing.

READ MORE Federal Government wins right to appeal ruling over medical transfer of refugees

Sergio Zanotti Stagliorio from Northam Lawyers, who represented PDWL pro-bono, said the ruling was a reminder that the Minister for Immigration was not above the law.

“The fact is the Minister seems to have kept our client in detention, not because there was a legal basis for doing so, but simply because the Minister didn’t like the tribunal decision. Whether one likes the tribunal decision or not they are binding. It comes back to the concept of the rule of law, no one is above the rule of law,” Mr Stagilorio told SBS News.

“The Minister didn’t like tribunal decision and used that to keep our client in detention and that’s absolutely outrageous,” he added.

SBS News contacted the office of the acting Minister for Immigration and Citizenship, Alan Tudge, for comment on the case. They did not respond.