The 81-year-old was held in April after police linked him to a conspiracy to murder the son of Prime Minister Sheikh Hasina.
Mr Rehman, a UK and Bangladeshi national, has been granted bail for three months.
His supporters describe his arrest as politically motivated.
Mr Rehman was the editor of Jai Jai Din, a mass-circulation Bengali daily, and, at the time of his arrest, he edited Mouchake Dhil, a popular monthly magazine.
He was also an adviser to opposition leader Khaleda Zia, who has continually demanded his unconditional release.
Several press freedom groups recently signed a letter urging Bangladesh to release him.
Prior to his arrest, Mr Rehman convened the international affairs committee of the Bangladesh Nationalist Party (BNP) and headed a pro-opposition think-tank called G-9.
Mr Rehman is the third pro-opposition editor to be detained since 2013.
Mahfuz Anam, editor of the English-language Daily Star newspaper, has been accused of treason for accusing Prime Minister Sheikh Hasina of corruption in 2007 when the country was run by a military government.
BBC South Asia correspondent Justin Rowlatt reported in February that both The Daily Star and its sister publication Prothom Alo were being subjected to a clandestine attempt to undermine their finances and stifle their operations.
The Supreme Court of Bangladesh has ordered the release on bail of magazine editor Shafik Rehman following his arrest on suspicion of sedition.