A convicted sex offender is set to remain in Australia after winning an appeal in the Federal Court against Home Affairs Minister Peter Dutton's order to deport him.

Key points: David Degning was released from Villawood Detention Centre yesterday after spending 16 months in custody

David Degning was released from Villawood Detention Centre yesterday after spending 16 months in custody The 57-year-old grandfather was convicted of a sex offence in 2013, but the Government's move to deport him was yesterday overturned

The 57-year-old grandfather was convicted of a sex offence in 2013, but the Government's move to deport him was yesterday overturned Two of the three Federal Court judges involved in the appeal found Mr Dutton had unfairly cancelled the visa

British citizen David Degning, 57, who has lived in Australia for more than 50 years, was yesterday released from Sydney's Villawood Immigration Detention Centre and reunited with his family on the NSW south coast after spending 16 months in detention.

The grandfather, who has voting rights and Australian children, has been fighting the deportation order since 2016 when the Department of Home Affairs moved to revoke his visa and return him to the United Kingdom for failing a character test.

Mr Degning has a long criminal history and was convicted in 2013 of having sexual intercourse with a person with a cognitive impairment. He was given a 17-month suspended sentence.

The list of offences also includes various drug, drink-driving and assault charges.

In August last year, the Federal Court dismissed Mr Degning's appeal to remain in Australia, but that decision was overturned by the full Federal Court on Tuesday on the grounds of procedural fairness.

Two of the three Federal Court judges found Mr Dutton had unfairly cancelled the visa.

The Department of Home Affairs is reviewing the court's decision.

In a statement it said: "The Australian Government is committed to protecting the Australian community from the risk of harm posed by non-citizens who engage in criminal conduct or behaviour of concern."

Mr Dutton used his discretion to cancel Mr Degning's permanent visa ( ABC News: Matthew Abbott )

Mr Degning's lawyer Stephen Blanks said his client was "ecstatic and dazed" to be reunited with his family at home on the NSW far south coast.

Mr Blanks said Mr Degning was considering claiming compensation, which he said could run into a "substantial figure".

"The whole idea that people with that level of connection to Australia can be deported on the most tenuous grounds when there is no cogent reasoning that they are a future risk to the Australian community is an extraordinary policy," Mr Blanks said.

"[It's] wrong [and] not a fair policy — in reality, it's a policy to break up families.

"We have to deal with people who have chequered pasts in our community, we don't solve any problems by sending them overseas."

Visa unfairly cancelled

Since 2014, the Federal Government has cancelled 4,500 visas under the character provisions set out in section 501 of the Migration Act.

The Department of Home Affairs used Mr Degning's failure to declare a criminal history on a series of passenger cards in the 2000s as evidence of his disregard for the law and re-offending risk.

Chief Justice James Allsop said the Department of Home Affairs did not make that point clear, or give Mr Degning an opportunity to respond.

"Mr Degning was not told that his general conduct was an issue; or that his dishonesty in relation to the passenger cards was an issue, and how it was an issue," Justice Allsop said in his judgement summary.

"It is neither obvious nor clear that this would somehow go to what appeared to be central: the protection of the Australian community from the re-offending in relation to a sexual offence."

Federal Court documents show Mr Dutton chose to exercise his "discretion to cancel" Mr Degning's permanent visa on the grounds Mr Degning represented an "unacceptable risk of harm to the Australian community".

He also stated that the protection of the Australian community "outweighed any countervailing considerations".

The Federal Court has ordered the Department of Home Affairs to pay Mr Degning's legal costs.