Presiding Judge Koichi Namba said the 55-year-old woman has lived in the country "peacefully for more than 20 years" and her de facto marriage to a Japanese man prior to the deportation order had been stable.

After entering Japan in 1988 with a different person's passport, she worked at an eatery in the city of Nagano and had two children with her Japanese spouse. After they divorced in 2001, she began living with another Japanese man in Saitama Prefecture in 2003, the court said.

Authorities found out about her immigration status in February 2012, prompting a deportation order against her the following April. She subsequently married the second Japanese man.

The plaintiff "was responsible for household chores for a long time and raised children," Namba said in the ruling. "Immigration authorities should have given her special permission to remain (in Japan), partly to protect the mature de facto marital relationship."

Last September, the Tokyo District Court upheld the deportation order against the woman on grounds that her illegal entry into the country and illegal labor were egregious.