After Mark Hughes was named by Dallas police as a suspect in the shooting deaths of five police officers downtown, he said he and his family got death threats and went into hiding.

He'd already been cleared and released by police, but he says the damage was already done.

Hughes, who was carrying an assault rifle in public on the night of the July 7, 2016, shootings, and his brother, Cory Hughes, on Monday sued the city of Dallas and its police department in federal court. They're alleging that their civil rights were violated.

The lawsuit claims police suppressed Mark Hughes' right to bear arms and free speech. And he alleges he was subjected to unlawful arrest and detention.

In the suit, Hughes says he brought his AR-15 rifle to a Black Lives Matter protest the evening of the shootings "as a symbol that African-American men had the right to exercise their Second Amendment privileges without fear of being gunned down."

Representatives of the city and police department declined Thursday to comment about the lawsuit.

The Hughes brothers and their lawyer could not be reached for comment.

The shooter, Micah Johnson, opened fire with an assault rifle at the end of the protest. He refused to negotiate with police after the ambush and voiced his intent to kill anyone who approached. Dallas police used a remote-controlled robot to kill him.

Hours earlier, Hughes joined about 800 people to protest the killings of Philando Castile and Alton Sterling. The two men were killed earlier that week by police in Minnesota and Louisiana. Both were black and both had guns.

Hughes says in the lawsuit that he allowed police to inspect his rifle when he arrived at the rally, which his brother helped organize. Photos of Hughes with the rifle over his shoulder were widely circulated.

When the shots rang out shortly before 9 p.m., Cory Hughes told his brother to give the rifle to police "so that Mark would not be mistaken as the shooter," the lawsuit said.

Mark Hughes gave his rifle to an officer and was given a receipt for it, the lawsuit says.

"The Hughes brothers then began to assist to the Dallas Police Department by helping people evacuate the area safely," the lawsuit said.

But then Dallas police tweeted a photo of Mark Hughes with his rifle shortly before 11 p.m. along with the caption: "This is our suspect! Please help us find him!"

Dallas police tweeted out a picture of Hughes carrying a rifle during the protest that preceded the ambush.

At a news conference broadcast live on Periscope after the shooting, then Police Chief David Brown displayed an image of Hughes and said: "Do not approach this suspect. We'll bring him to justice."

Hughes was walking toward his car when someone told him he'd been identified as a suspect, the lawsuit says. He approached some officers and was arrested. Cory Hughes went to police headquarters and was also held for questioning, the lawsuit says.

Shortly after the first shots, The Dallas Morning News' photo account tweeted a video from downtown Dallas. In it, Hughes could be seen walking down the street holding a gun pointed to the ground as police sped past.

The News retweeted a city spokeswoman's tweet that described Hughes as a possible suspect and contained a photo of him and posted a story on dallasnews.com about the search for the suspect. Minutes later The News sent its own tweet that cited the police chief and referred to Hughes as a "person of interest."

Once The News learned Hughes was not a suspect, it quickly updated the story to reflect the misidentification.

Standoff: How the Dallas SWAT team cornered and killed the July 7 police shooter

The brothers allege they were "interrogated without proper Miranda warnings." An attorney hired by their family wasn't allowed to speak with the brothers, the lawsuit says. When they "passed forensic testing," the brothers were driven downtown and released the same night, the suit says.

But the department's social media posts identifying Mark Hughes as the murder suspect remained for the next two months, the lawsuit says.

And for the following five months, Dallas police "repeatedly rebuffed" Hughes' request that they return his rifle and other belongings, the lawsuit says.

The Hughes lawsuit alleges unlawful seizure of his property, "negligent training" of officers and intentional infliction of emotional distress. The lawsuit does not say how much money the plaintiffs are seeking.

Mark Hughes, who at the time owned a Fort Worth snow cone stand, told The Dallas Morning News about a week after the shootings that he still wasn't able to return home because he'd been named as a suspect.

"I became the most wanted man in America," he told The News. "We get death threats daily. It's a nightmare."