The Tokyo High Court on Wednesday overturned a lower court ruling that resulted in the release of five Afghans detained by immigration authorities while applying for refugee status.

"The five men entered Japan for the purpose of finding work," presiding Judge Yomatsu Hinagata said, favoring the Tokyo Regional Immigration Bureau's appeal. The Justice Ministry in November rejected the refugee-status applications lodged by the men.

An appeal filed by the five Afghans seeking that their detention be suspended was recognized by the Tokyo District Court on Nov. 6. The district court said the detention was "against international order" as it was "tantamount to ignoring the Convention Relating to the Status of Refugees, which takes precedence over (Japan's) immigration laws."

After their release, the five men called on the government to recognize them as refugees. The latest ruling means they may again be taken into custody.

They are among nine Afghans who were detained Oct. 3 on suspicion of illegal entry when they were applying for refugee status. The four others were also denied refugee status in November.

Those four are being held at one of the bureau's detention facilities in Ushiku, Ibaraki Prefecture, after a different judge at the Tokyo District Court on Nov. 5 rejected their appeal for release. The immigration bureau is preparing to deport them.

The high court, in the same ruling, upheld the lower court's decision to keep the four men in detention.

Kensuke Onuki, one of the lawyers for the nine men, called the high court's ruling "unfair" but said he will follow the order. He added he may take further legal countermeasures, declining to elaborate.

Yasushi Takayama, chief of the bureau's legal division, said he will meet with other bureau officials to consider whether to again detain the five men.