A four-judge panel has voted to release former Brazilian President Michel Temer from jail while he faces an investigation into alleged corruption. But he won't be freed until another judges signs off on his release.

Tuesday's ruling by a superior court in Brasilia found that the circumstances don't justify the use of preventive custody for the 78-year-old politician, who left the presidency Jan. 1.

Temer has been detained since May 9 at a police station in Sao Paulo while being investigated on allegations he took bribes from a construction company in exchange for government contracts. He denies any wrongdoing.

Temer's defense team says it is not clear when the judge will rule on the release order.