A man given New Zealand residency on the basis he was still married to a woman he had actually divorced has lost an appeal to stay in the country.
In an added twist, Afroz Khan, 49, from Fiji, remarried the woman he had divorced and she backed his fight to stay.
Mr Khan's wife said she did not know he had divorced her in 2001 after 15 years of marriage, nor that he had twice remarried in the years they were apart. She didn't explain how she remained unaware she had been divorced.
According to documents from the Immigration and Protection Tribunal, Mr Khan divorced his wife on the grounds of adultery in 2001.
A year later she moved to New Zealand on a student visa and was then granted a series of work permits to remain in the country on the basis of her work as a health care assistant.
In August 2002, Mr Khan married his new partner and lived with her in Fiji for four months.
In February 2003, he applied for a work visa for New Zealand on the basis that his first wife held a current work permit.
"The person that he declared as his wife was his former wife and he provided a copy of their marriage certificate. His application for a work visa was approved on this basis," the tribunal's report said.
Mr Khan travelled to New Zealand in April, 2003, presenting his work visa at immigration, but only stayed a week. In June 2003, he divorced his second wife.
Over the next six months he visited New Zealand four times, staying for short periods each time.
In June 2004, he applied for a further work permit on the basis that his first wife held a current work permit, which was approved.
In March 2005, Mr Khan's first wife was granted residency. Mr Khan was also granted residency - on the basis that she was his wife. Over the next five years he visited New Zealand eight times, spending only short periods each visit.
In April 2008, Mr Khan was then issued a two-year returning resident's visa on the basis of his marriage to his first wife. But in July that year he married his new partner in Fiji. This marriage lasted a year.
In May 2010, another two-year returning resident's visa was issued to Mr Khan on the basis that he was married to his first wife.
The pair eventually remarried in 2012, a month after Khan was convicted of immigration fraud after admitting he supplied false and misleading information to Immigration New Zealand between 2003 and 2010 relating to his marriage to his first wife.
Mr Khan was ordered to be deported but lodged an appeal against this on humanitarian grounds in November 2012.
His first wife and the couple's two daughters, aged 26 and 20, were now New Zealand citizens. His wife said she suffered from illness and depression and would be severely affected by his deportation to Fiji.
However, the tribunal ruled there were no exceptional circumstances that would allow him to remain in New Zealand.
"The tribunal is satisfied that it is not unjust or unduly harsh for him to be deported from New Zealand. He has not shown a level of harshness that goes beyond the level that must be regarded as acceptable in order to preserve the integrity of New Zealand's immigration system," the tribunal's decision stated.
It said Mr Khan had "consciously and repeatedly manipulated New Zealand's immigration system to obtain entry into and ultimately reside in New Zealand by wrongful means".