Russian investigative journalist Ivan Golunov, charged with attempted drug-dealing, stands inside a defendants' cage during a hearing at a court in Moscow on June 8, 2019. Getty

Moscow -- Russian police have dropped all charges against a prominent journalist five days after he was detained on controversial drug charges and beaten in custody. The abrupt change in course on Tuesday came amid an unprecedented public outcry over the treatment of investigative reporter Ivan Golunov.

"A decision has been made to close a criminal case against Golunov and drop all charges against him," Vladimir Kolokoltsev, Russia's Minister of Internal Affairs, announced in a statement on Tuesday. "Golunov will be released from under house arrest by the end of today."

The unexpected move came after days of unprecedented support for Golunov from Russia's normally fragmented media community. Large crowds had picketed outside Moscow police headquarters day and night, and dozens of media outlets demanded his release, joined by hundreds of prominent individual journalists, artists, musicians and politicians.

Get Breaking News Delivered to Your Inbox

Prominent journalists had planned a mass demonstration on Wednesday, which is Russia Day, a national holiday in the country, to demand his release. As of Tuesday afternoon, more than 24,000 people had signed up to attend on the event's Facebook page. The police announced Golunov's pending release less than 24 hours before the event, but organizers said the rally would go on as planned, in support of press freedom.

"Persecuted for his journalism"

Golunov was detained on June 6. He is well-known in the media community for his extensive reporting on the corruption that plagues Moscow's local government, real estate and microfinance fraud, and links between high-ranking government and law enforcement officials and Russia's shady funeral industry. Golunov was on his way to meet a source when police stopped him last Thursday.

Investigators claim they found mephedrone, an illegal synthetic stimulant, in his backpack and in the apartment he rents in Moscow. Golunov has insisted the drugs were planted on him, and the arrest was punishment for his work.

Russian investigative journalist Ivan Golunov, who was detained by police and accused of drug offences, reacts inside a defendants' cage as he attends a court hearing in Moscow, Russia June 8, 2019. The writing on the T-shirt reads "Editorial desk demands blood." REUTERS

News of his detention came out the next day, on June 7. For 14 hours the police didn't allow Golunov to call a lawyer or his family. They beat the journalist and refused to test him for drug use or his hands for traces of drugs.

Golunov's colleagues and friends immediately spoke out, insisting Golunov never used drugs and that the case against him was just to pressure him over his latest investigation.

"We have reasons to believe that Golunov is being persecuted for his journalism," Ivan Kolpakov, editor in chief of the Meduza news outlet where Golunov worked, said in a joint statement with the outlet's executive Galina Timchenko. "We know that in recent months Vanya was receiving threats; we know which story (these threats were connected to); we have an idea who (sent the threats)."

Others have noted that journalists who investigate sensitive topics in Russia are unlikely to take the unnecessary risk of carrying illegal drugs.

"In Russia, investigative journalists would cross a street carefully, on green light only, in order not to give (law enforcement) reasons (to find fault with them). They pay all taxes and utility bills, so that they can't be accused of anything," Svetlana Reiter, a BBC Russia correspondent and friend of Golunov's told Meduza.

As public outcry over his arrest mounted, police released 10 photos of what they claimed was a drug lab in Golunov's apartment. The move was unusual; Russian law enforcement rarely reveal evidence in this manner. Golunov's friends, who know his apartment, said that only one of the 10 photos actually showed his home.

Several hours later the police deleted the photos, admitting that most of them were taken in a different place. Public support for Golunov grew.

Moved to house arrest

Several hours after Golunov's arrest made headlines on June 7, prominent Russian journalists started gathering in front of the police headquarters, demanding his release. They took turns, holding one-person pickets -- the only form of protest that doesn't require authorisation from the authorities.

The first group of protesters was quickly detained, but that only bolstered support for Golunov, and the line of people willing to hold the one-person picket spot for him grew.

On June 8, people started gathering in front of a district courthouse on the outskirts of Moscow where Golunov was expected to be charged and arraigned. By the time he was brought there from a hospital, where doctors examined the injuries he sustained in police custody, the crowd at the courthouse was bigger than the one from the day before.

Police officers detain a participant of a rally in support of arrested journalist Ivan Golunov outside the headquarters of the Moscow branch of the Russian Interior Ministry in Moscow on June 7, 2019. Getty

Supporters surrounded the courthouse as the police charged Golunov with attempted drug dealing, a criminal offense that carries a 10 to 20 year prison sentence in Russia. Investigators asked the court to hold Golunov in custody pending investigation.

But in an unexpected turn late that same day, a judge ordered that Golunov be moved to house arrest. The crowd outside the courthouse exploded in applause, chanting "Ivan is innocent."

"It's not over"

The move to house arrest did not quiet the calls for Golunov's full release.

"It's not over, don't let them shrug you off by saying, 'what else do you want, he's not in jail?'" journalist Tatyana Felgengauer, of independent Russian radio station Ekho Moskvy wrote on the Telegram messaging app. "There shouldn't be a case against Ivan Golunov at all. We will call it a victory only when Ivan is free, the case is closed, and those who fabricated it are prosecuted."

On Sunday, pickets in front of the police headquarters resumed, and they went on until the next morning. On Monday, three major independent newspapers in Russia, Kommersant, Vedomosti and RBC, published the same front page for the first time ever. It said "I am/We are Ivan Golunov." All three newspapers sold out within hours.

The decision to release Golunov brought celebratory comments from the media community, but at the same time the journalist's supporters demanded the circumstances of his arrest and the alleged planting of the drugs be investigated.

"People who organised this crackdown on Ivan have not been named," a statement released by Meduza read. "This is just the beginning, there's a lot of work ahead -- we need to make sure this never happens again, to anyone."

Russia's Interior Ministry announced the firing of two high-ranking police officers in the aftermath of the case, and multiple police officers suspected of involvement in Golunov's arrest were suspended pending an internal investigation, officials said.