Carlos Ghosn’s appeal against his ongoing detention was rejected by the Tokyo District Court, according to a statement released by the court Wednesday. The ousted Nissan chairman’s lawyers will now appeal the decision at a higher court, NHK reported.

Wednesday’s decision by the judge means the auto industry icon, who is fighting charges of financial misconduct related to his time while heading Nissan Motor Co., could remain behind bars until a possible trial, which his main lawyer, Motonari Otsuru, has said may not be for another six months. Ghosn’s current period of custody ends Friday, but prosecutors are likely to hand him fresh charges or request another extension as they build their case against him.

Separately, sources said Wednesday that Ghosn had planned to extend a loan of ¥3 billion ($27 million) to a Saudi businessman through the carmaker, possibly to use as collateral for his private investment contract. The plan did not materialize as Nissan felt there would be legal problems, the sources said.

Prosecutors have arrested Ghosn for allegedly transferring personal investment losses to Nissan during the 2008 global financial crisis and causing damage to the automaker by making it pay $14.7 million to Khaled Al-Juffali, the businessman who guaranteed credit for Ghosn, between 2009 and 2012.

According to the sources, Ghosn compiled a document to extend a loan of ¥3 billion to Al-Juffali’s company in January 2009 after being asked for additional collateral by Tokyo-based Shinsei Bank, with which he had a currency swap contract that incurred an appraisal loss of ¥1.85 billion due to the financial crisis.

The contract was shifted to Nissan in October 2008 from Ghosn’s private asset management company and was transferred back to the management firm in February 2009 after Al-Juffali guaranteed credit.

In a Tokyo court hearing Tuesday where he made his first public appearance since his arrest in November, Ghosn denied that the $14.7 million payment in question was in exchange for guaranteeing credit.

Ghosn claimed it was proper compensation for business activities in the Middle East, including resolving a dispute with a local dealer.

The former Nissan chairman has also told prosecutors that he transferred the private investment contract to the company only temporarily to earn the automaker’s creditworthiness, but intended to return it to his asset management firm from the beginning, the sources said.

At the court hearing, the former Nissan boss asserted his innocence and said the carmaker incurred no losses from his private investment contract.

Ghosn has been detained since Nov. 19, when he and his close aide, Greg Kelly, were initially arrested on suspicion of understating the former chairman’s ¥10 billion remuneration by roughly ¥5 billion in Nissan’s securities reports during the five years through March 2015.

The two were charged on Dec. 10 and served with fresh arrest warrants for similar misconduct during the three years through March 2018.

Ghosn’s detention was further extended after he was served with a third arrest warrant on Dec. 21 for alleged aggravated breach of trust involving the transfer of personal investment losses to Nissan in 2008.