The Supreme Court upheld Wednesday a high court decision to detain a Nepalese man for appeals procedures in a murder and robbery case, despite the man being found not guilty of all the charges by a lower court.

The top court was divided on the case, however, with three of the five judges supporting the high court decision and the remaining two opposing it.

The defense team for 33-year-old Govinda Prasad Mainali, who had also overstayed his visa, filed the appeal last month with the Supreme Court. They argued that the Tokyo High Court’s decision in May to allow the detention of Mainali to facilitate criminal court appeals hearings was unjust, claiming that such a decision should only be made after an appeals hearing details strong reasons to do so.

In April, the Tokyo District Court acquitted Mainali of the charge of murdering a female employee of Tokyo Electric Power Co. in 1997.

He was then released from custody, but was immediately handed over to immigration authorities for overstaying his visa and was awaiting deportation.

However, the high court decided in May to accept prosecutors’ demands that Mainali be detained again ahead of appeals procedures. He is currently in the custody of the Tokyo High Public Prosecutor’s Office.

The Supreme Court said in its decision Wednesday that the high court has the authority to detain a person if it decides such action is necessary, and that decision can be reached merely by going through documents from the original trial, even if the lower court decided to acquit the defendant.

The top court said Mainali’s status as a visa overstayer facing deportation met the conditions of the Criminal Procedure Law, which states that defendants may be kept in custody if they have no fixed address and the court has reason to suspect that they might attempt to hide evidence or disappear.

However, Judge Mitsuo Endo said that an acquitted person can only be detained if appeals hearings find strong evidence to suggest that the accused was guilty.

He added that the detention occurred only because of Mainali’s position as an illegal resident facing deportation and that he should not suffer as a result of the conflicting legal procedures of criminal and immigration authorities.

Presiding Judge Masao Fujii also said the high court’s decision to allow his detention even before the appeals hearings began was inappropriate in that it disregarded the lower court’s not-guilty ruling.