Joshua Wolf, 24, posted online unaired videotape that he had refused to give authorities, federal prosecutor Jeffrey Finigan said in court papers. U.S. District Judge William Alsup, who had jailed Wolf for 226 days in a California prison, approved his release.
Wolf had been held for refusing a subpoena to turn over videotape he shot of a chaotic 2005 San Francisco street protest against the G-8 Summit, which was taking place a continent away in Scotland.
The government was investigating how a San Francisco police officer got his skull fractured during the melee and the alleged torching of a police car.
The footage Wolf posted Tuesday does not capture the alleged crimes authorities are investigating, defense lawyer David Greene said.
As part of the deal, prosecutors said they were not inclined to seek Wolf's grand jury testimony, but left open that possibility.
Wolf's incarceration surpassed that of Vanessa Leggett, a Houston-based freelancer who served a record 168 days in 2001 and 2002 for declining to reveal unpublished material about a murder case.
Wolf's lawyers argued that the First Amendment gave him the right to refuse the subpoena to turn over the rest of his tape.
But Alsup cited a 1972 U.S. Supreme Court ruling that the U.S. Constitution does not entitle reporters, or anybody else, to withhold their confidential sources or unpublished material in a grand jury investigation or criminal trial.
California's shield law allows reporters to keep sources and unpublished material secret. But there is no federal shield law protecting reporters from federal investigations.