(CNN) A Birmingham, Alabama, police detective who was pistol-whipped unconscious said Friday that he hesitated to use force because he didn't want to be accused of needlessly killing an unarmed man.

"A lot of officers are being too cautious because of what's going on in the media," said the officer, who asked to remain anonymous for the safety of his family. "I hesitated because I didn't want to be in the media like I am right now."

Details of last week's incident in the Birmingham enclave of Roebuck remain sketchy -- such as how did the suspect get the officer's weapon -- but the six-year police veteran said he didn't shoot the man who attacked him during a traffic stop because of the outcry surrounding a spate of police shootings nationally.

"We don't want to be in the media," he said. "It's hard times right now for us."

The scene where an officer was assaulted in Alabama.

Heath Boackle, a sergeant with the Birmingham Police Department and president of the city's Fraternal Order of Police, said Thursday that cops are "walking on eggshells because of how they're scrutinized in the media."

"We should be thanking the good Lord because he could be dead right now.," Boackle said of the detective who was beaten.

Police Chief A.C. Roper sees the episode -- as well as the reaction, including celebratory and vitriolic comments posted online alongside images of the wounded officer -- as symptomatic of a larger problem, in which some don't respect law enforcement.

"The nobility and integrity of policing has been challenged," Roper said. "As a profession, we have allowed popular culture to draft a narrative which is contrary to the amazing work that so many officers are doing everyday across this nation."

Detective struck with his own weapon

The incident occurred last Friday when the detective was on his way to interview a robbery witness and saw a car that was carrying at least two people traveling erratically on the interstate, according to police.

"He calls for backup and tells the man to stay in the car, but he didn't," Boackle told CNN in a phone interview. "The last thing the officer remembers is getting sucker-punched in a parking lot. The next thing, he's waking up in a hospital bed with staples in his head."

According to Boackle, the detective spoke to Janard Cunningham, who was sitting the car. The detective decided to call for backup so that he could continue his robbery investigation while another officer handled the traffic stop.

While he was calling for backup, Cunningham allegedly exited the car and became aggressive, approaching the detective and repeatedly questioned why he'd been pulled over, the union chief said. The detective considered using force but thought better of it and continued his call when Cunningham hit him, Boackle said.

Cunningham is accused of then "pistol whipping" the officer with his own service weapon, Boackle said.

The officer suffered multiple lacerations to his head and face but is expected to recover from his injuries, according to Boackle. The University of Alabama-Birmingham treated and released him the same day. He's recovering at home and has not yet returned to duty, Boackle said.

Chief calls reaction 'absolutely inhumane'

Adding insult to injury: several bystanders, instead of helping, took pictures of the bloodied officer as he was facedown on the concrete and posted the images on social media, where the officer was mocked.

Many people rose to the officer's defense, but the detective's colleagues were outraged by a collection of posts that seemed to revel in the beating.

"Pistol whipped his ass to sleep," one user wrote, employing the hashtag #FckDaPolice. Another mockingly offered the officer milk and cookies for his "nap time."

Roper, the Birmingham police chief, called the fact bystanders would take pictures of an officer being beaten rather than help him, then proceed to post them, "absolutely inhumane." The online commenters only made it worse.

"It really speaks to the lack of their morality and humanity," the chief said. "People commented on the pictures in a celebratory fashion ... disregarding that this public servant has a family and is committed to serve in some of our most challenging communities."

Police support officer, who is 'doing much better'

Some Birmingham officers feel that "if the roles were reversed, there would be demonstrations" and an "outcry from the public," Boackle said.

"The officer was beaten and just left there. People were there long enough to take pictures of the officer full of blood and put it on social media. ... No one stopped to help," he said. "We're lucky we're not talking about an officer who was shot and killed with his own weapon."

CNN affiliate WBRC tweeted a photo depicting the bleeding officer.

Birmingham Police say this Detective was pistol whipped Friday after stopping a vehicle at 9150 Parkway East. pic.twitter.com/dGSNteoMT2 — Kelvin Reynolds (@Fox6Kelvin) August 8, 2015

According to the city's police chief, the officer is "doing much better than he was on the day of the attack." Roper said his department stands firmly behind a man who he called a "good officer through these years."

"I gave him a direct order," Roper said. "Your mission is to get better and to spend time with your family. He gladly accepted."

Suspect charged with attempted murder

Cunningham allegedly fled the scene but was apprehended later Friday, police said. He is charged with attempted murder and is being held without bond. A second man taken into custody with Cunningham has not been charged with a crime, police said.

Tracking dogs were brought in to help search for another possible suspect, but authorities later said they believed there was no third person.

Cunningham, 34, of Center Point appeared in court Tuesday where his first hearing was postponed, CNN affiliate WBRC reported . His mother told Jefferson County District Court Judge Shelly Watkins that the family would be hiring a lawyer, according to the Alabama Media Group , a collection of news outlets that includes The Birmingham News.

Paperwork on file in Watkins' office had no lawyer listed for Cunningham. His mother hung up on a CNN reporter seeking comment, and a subsequent voice message left for her was not immediately returned.

"I feel that in today's society, both from law enforcement and the citizens, we have to trust in one another and do the best we can for this world as a whole," Boackle said.

Said the officer who was beaten: "I appreciate everyone's support. I have a concussion and I'm still heavily medicated. Right now, I need to focus on healing and getting better."