Bosnia's Constitutional Court ruled on Friday that the president of the autonomous Muslim-Croat federation, charged with corruption, had been detained illegally, and ordered a lower court to release him immediately.
Zivko Budimir was arrested along with 19 other officials in late April in the most high-profile anti-corruption drive in Bosnia since independence more than two decades ago.
A court ordered Budimir and his co-accused aide to be kept in detention because they held Croatian passports and there was a risk they might try to flee.
Budimir has been charged with accepting bribes to grant amnesty to a number of convicts.
“The case has been returned to the [state] court, which is obliged to make a new decision immediately in line with the Constitution and the European Convention on Human Rights,” the Constitutional Court said in a statement.
Budimir's lawyer Ragib Hadzic said the court had determined there were no grounds to keep him in custody while the investigation was underway.
The arrest of Budimir has exacerbated a political crisis that blew up last year when he refused to approve a Federation government reshuffle and the appointment of judges to the Constitutional Court.
Bosnian Prime Minister Vjekoslav Bevanda said this week that a failure by Budimir to sign a law cutting military pensions might delay the International Monetary Fund's release of the next tranche of a loan.
Under the deal that ended Bosnia's 1992-95 war, the country was split into a Muslim-Croat Federation and a Serb Republic that are held together by a relatively weak central government.