The Dallas police department has come under fire for releasing an image of a man they said they were searching for as a suspect in the immediate aftermath of the shooting.

The man, named Mark Hughes, turned himself in after a photo of him holding a rifle was circulated on social media and on national television. He was later released.

This is one of our suspects. Please help us find him! pic.twitter.com/Na5T8ZxSz6 — Dallas Police Depart (@DallasPD) July 8, 2016

Five law enforcement officers were killed and six others injured when shots were fired in Dallas, Texas, near a protest over the recent police shootings of Alton Sterling and Philandro Castile.

At a press conference, police called the man in the photo a "person of interest," but he was seen on camera with other marchers when the gunfire started.

Many people on Twitter called out the Dallas police department for being irresponsible with the photo and urged them to delete the tweet with the picture.

Mark Hughes turned himself in after being called a suspect by media, while @DallasPD only called him a POI.

Why? Black men can't open carry — Ramon Romero Jr. (@RepRamonRomero) July 8, 2016

Mark Hughes' attorney tells me Hughes is getting threats. He is not in police custody. Now in "safe location". pic.twitter.com/PTzMclgM1l — Allison Harris (@allisonfox4news) July 8, 2016

I hearing that @DallasPD has cleared Mark Hughes. They're tweeting other things, but not that. And his pic remains up as a suspect. #Dallas — ☔️ April ☔️ (@ReignOfApril) July 8, 2016

here's the 'blamed suspect', mark hughes handing his gun to the officer, he is NOT the shooter, please share #Dallas pic.twitter.com/htKTHc6esu — hafsa (@BadBoiZlatan) July 8, 2016

Mark's brother Cory Hughes, a protest organiser, told KTVT he was "100 percent sure" his brother was not a suspect and he was getting death threats as a result of the misidentification.

"My brother was marching with us. Because he's my brother and I understood the severity of the situation, I told my brother, 'Give that gun away,"' Cory Hughes said. "He never thought that by exercising his right, he'd be plastered over the national media as a suspect."

Mark Hughes' attorney tells me Hughes is getting threats. He is not in police custody. Now in "safe location". pic.twitter.com/PTzMclgM1l — Allison Harris (@allisonfox4news) July 8, 2016

A video later surfaced showing Mark Hughes handing over his rifle to police while also receiving a business card from an officer.

Here is video of Mark Hughes turning his gun into police while also receiving a business card from an officer. pic.twitter.com/75dnyjfE7S — Jessie Karangu (@JMKTV) July 8, 2016

Hughes was later interviewed by KTVT and expressed his shock at seeing his picture being plastered all over the place: “I can’t believe it. I can’t believe it. The crazy thing about it is that, I was down here, I couldn’t get down to my vehicle because of the roadblock. And in hindsight, 20/20, I could have easily been shot.”

Rightfully so. RT @MatthewKeysLive: KTVT found the man Dallas Police earlier called a shooting suspect. He's pissed. pic.twitter.com/yhNpxF4UcY — Philip Lewis (@Phil_Lewis_) July 8, 2016

In the video Hughes said that as soon as he saw his picture, he immediately flagged it to police. So while the country was looking for him, Hughes was "laughing and joking with police officers," he said.

Hughes said he was interrogated for 30 minutes with police officers "lying" that they had a video of him shooting.

“At the end of the day, the system was trying to get me," he said.

Hughes said he had not received an apology: “We asked them, we said, now you all have my face on national news, are you going to come out and say this young man had nothing to do with this?”

Have something to add to this story? Share it in the comments.