The prosecution filed the detention request on Thursday saying that Glavas had affected future witnesses by publishing a report from the ongoing war crimes investigation against him.
The investigating judge rejected the request on grounds that the parties to the case had signed a statement pledging that they would not disclose details of the investigation to the public, whereby the secrecy of the proceedings was guaranteed, Zagreb County Court spokesman Kresimir Devcic told reporters.
Devcic said that the Chief Public Prosecutor's Office had the right to appeal within 48 hours.
After a hearing on Monday, Glavas circulated two witness statements to the press and posted them on his Internet site.
This prompted the investigating judge to request the parties to the case to sign a statement pledging they would not reveal details of the investigation to the public.
Glavas is charged with ill-treating three ethnic Serb civilians in the eastern city of Osijek in 1991 and murdering another two, one of whom disappeared without trace.