WASHINGTON — A federal judge ruled in favor of BuzzFeed in a defamation lawsuit over its publication of the so-called “Steele dossier” in January, 2017, ruling that because the document was part of an official proceeding, the site was protected by fair reporting privilege.

U.S. District Judge Ursula Ungaro wrote that the “privilege exists to protect the media while they gather information needed for the public to exercise effective oversight of the government.”

The plaintiffs in the case, Aleksej Gubarev, a resident of Cyprus, and his company XBT Holdings, allege that they were defamed because the dossier reported that he and his company were involved in hacking attempts on the Democratic party leadership during the 2016 presidential election. The plaintiffs said that the information about them in the dossier was false, but BuzzFeed never contacted them to determine whether the allegations had merit.

BuzzFeed published the 35-page dossier on Jan. 10, 2017, with the disclaimer that the dossier is “not just unconfirmed: It includes some clear errors.”

The document was prepared by Christopher Steele, a former British intelligence agent tasked by a private research firm to investigate ties between Donald Trump and his business interests. The research firm, FusionGPS, had initially been retained by the conservative website the Washington Free Beacon and later by a law firm working for the Democratic National Committee.

Steele also had been a source for the FBI, although Ungaro noted that before receiving his reports, the agency had already opened a counterintelligence investigation into links between Russia and the Trump campaign.

BuzzFeed published the dossier after CNN reported on its existence, as well as a preparation of a two-page synopsis used to brief President Barack Obama and President-elect Trump. CNN also reported that the FBI was investigating the credibility of the information in the dossier. BuzzFeed’s report linked to the CNN article.