Australian authorities tried to send to New Zealand a criminal who was born here only because his pregnant Australian mother became ill during a visit and gave birth.
Adam Carey, now 49, has a string of criminal convictions including drug-trafficking and having sex with a minor, a 15-year-old girl he injected with methamphetamine.
Carey, who has New Zealand citizenship by dint of his mother's accidentally delayed visit to New Zealand, is an Australian citizen in all but name, according to the Australian Administrative Tribunal (AAT).
Despite being automatically entitled to Australian citizenship through earlier legislation, his application was turned down in 2017.
The tribunal has now overturned that decision and sent Carey's application to Immigration Minister Peter Dutton for reconsideration.
Dutton did not respond to requests for comment.
The AAT said in its decision that Carey spent four months in New Zealand as a baby in 1969. His mother had been visiting when she became ill, delaying her return to Australia, and gave birth to her son in New Zealand.
"The fact of Mr Carey's birthplace gave him a statutory entitlement to the New Zealand citizenship status he now holds. Conversely, his mother's status contingently entitled him to Australian citizenship."
Other than another four years spent in New Zealand as a teenager, Carey has spent all his time in Australia where he racked up 39 convictions and two stints in prison.
He was jailed in 2002 for trafficking drugs. He was sent to prison again in 2005 for carnal knowledge of a minor after having a relationship with 15-year-old girl, who told police he injected her with methamphetamine and supplied her with cannabis, according to the AAT decision.
Dutton has been frustrated by his inability to deport Carey, telling radio station 2GB it was a "stupid situation".
"This guy is a creep and he should be kicked out of the country and that's very clear on the facts ... but this is a big frustration.
"You can't stand that these people are here committing multiple offences, serious offences against multiple Australian victims and somehow they're allowed to stay.
"People should have their day in court but at the moment the way in which the AAT is operating in many of these cases is completely unacceptable to the community," he told 2GB.
Dutton would like to see change at the AAT and changes to citizenship laws that would give him more power to deport people he considers not of good character or a danger to the community.
Legislation that would have given him that power was struck down by the Senate in 2017.
Separately, a committee is currently hearing submissions on changes to the AAT that would essentially give the minister even more discretion to cancel visas.
Barrister Greg Barns, spokesman for the Australian Lawyers Alliance said Dutton's "contempt for the independence of the courts and tribunals of this nation is frightening.
"The Carey case was clearly one where deportation should never have been considered."
In New Zealand, the Internal Affairs Minister has the power to deprive someone of citizenship but it is rarely used and generally only in cases where false or misleading information was used to obtain citizenship.
Cases like Carey's, who obtained New Zealand citizenship through "quite out of the ordinary circumstances, as the AAT put it, could not occur now.
Since January 1, 2006, babies born in New Zealand are citizens only if their parent is a New Zealand citizen or permanent resident, unless they would be stateless because they would not inherit their parents' citizenships.