Shortly after a gunman entered Marjory Stoneman Douglas High School in Florida in February and killed 17 people, the conspiracy theory website Infowars claimed it had a photo of the attacker wearing “communist garb.” It showed a young man with a clenched fist in a red shirt emblazoned with a hammer and sickle and images of Joseph Stalin, Vladimir Lenin and Karl Marx.

But that man was not Nikolas Cruz, who was arrested two miles from the Parkland, Fla., school on Feb. 14 and later confessed to the shooting, the police said. The man in the red shirt was Marcel Fontaine, who lives 1,200 miles away in Massachusetts and has never visited Florida.

On Monday, Mr. Fontaine filed a defamation lawsuit against Infowars, one of its reporters and its right-wing founder, Alex Jones, asserting that their story misidentified him as the gunman and caused his photo to spread across social media, message boards and other websites. In the lawsuit, a lawyer for Mr. Fontaine said it appeared that Infowars published his photo simply because of his shirt.

“Mr. Jones and Infowars have long been consumed with paranoia over the prospect of communist infiltration and indoctrination,” the lawsuit, filed in Travis County District Court in Austin, Tex., said. “Over the past year alone, Infowars has featured hundreds of sensationalist articles and videos focusing on the threat of communist agitation and conspiracies.”