The US government "does not have the right to rummage" through a website's logs to identify protesters at Donald Trump's inauguration, a judge has ruled.
DreamHost has won protections for its users after fighting against a warrant ordering it to identify visitors to a site that encouraged protests on the day he was sworn in.
Riots in Washington DC saw police use tear gas and stun grenades to break up violent protests on 20 January.
At the time, District of Columbia police chief Peter Newsham said 217 people had been arrested and charged with rioting, while six officers suffered minor injuries.
The US Department of Justice (DoJ) wanted DreamHost to hand over the 1.3 million IP addresses of everyone who visited the disruptj20.org website, which organised some of the demonstrations.
DreamHost fought the warrant, stating: "That information could be used to identify any individuals who used this site to exercise and express political speech protected under the Constitution's First Amendment."
In a revised court order, Chief Judge Robert Morin agreed with this argument, ruling important "procedural safeguards" needed to be in place for the government to execute the warrant.
"The government does not have the right to rummage through the information contained on DreamHost's website" when it could identify protesters "who were engaging in protected First Amendment activities".
DreamHost said: "We see this as an absolute victory not just for DreamHost, but for online service providers throughout America and for internet users around the world."
:: Meanwhile, in the UK…
A similar request by Hertfordshire Police to force satirical magazine Private Eye to hand over its subscriber list was thrown out of court this month.
The force was investigating a potential hate crime after a Muslim employee was sent an anonymous clipping from Private Eye through the force's internal mail system.
As such, it issued a production order to the magazine to hand over its entire subscriber list for Hertfordshire and the surrounding counties.
When the magazine refused, the police force took it to court.
Dismissing the case, Judge David Farrell QC said: "This is not a proportionate or reasonable application to make… It's a shot in the dark and in the circumstances not proportionate to grant."