An Afghan man charged with converting to Christianity is set to be released from jail while his case is reviewed.
Abdul Rahman converted to Christianity 16 years ago
Abdul Rahman's case has been handed back to the attorney-general because of gaps in the evidence, an official said.
Speaking on condition of anonymity, the official said that while the attorney-general looked at the papers, Mr Rahman did not need to be detained.
Mr Rahman, a Christian for 16 years, was charged with rejecting Islam and potentially faced the death penalty.
Afghanistan's legal system is built on Islamic Sharia law, and Mr Rahman could have faced execution if he had refused to renounce Christianity.
The Afghan government has come under increasing pressure over the case, says the BBC's Sanjoy Majumder in Kabul.
Key international backers of President Hamid Karzai have called for Mr Rahman's release, while Muslim conservatives in Afghanistan are in favour of his detention.
Mr Karzai has personally intervened in the case and several top level meetings have been held over the past two days to resolve the issue.
Details of his imminent release are being kept secret, as feelings in Kabul have run high over the case.
Earlier, Mr Rahman's family asked the court to dismiss the case against him, saying he suffered from mental illness.
Supreme Court Judge Ansarullah Mawlavizada told the BBC there was considerable doubt that Mr Rahman was fit to stand trial.
According to Judge Mawlavizada, Mr Rahman appeared "disturbed".
He said the accused man's relatives had told the authorities he was insane and that they claimed Mr Rahman had said he heard strange voices in his head.
The judge also said it was not clear if the accused was really an Afghan or a citizen of another country.
Mr Rahman has lived outside Afghanistan for 16 years and is believed to have converted to Christianity during a stay in Germany.