(CN) - Three North Carolina police officers used excessive force when they Tased a mentally ill man to death while taking him into custody, but they are nevertheless immune from prosecution because they didn't think they were violating the man's rights at the time, the Fourth Circuit ruled.

The decision by the three-judge panel upheld an earlier ruling by U.S. District Judge Catherine Eagles, but came with a warning that force as applied by the officers in the non-violent situation at the center of the case violates the Fourth Amendment.

On April 23, 2011, Ronald Armstrong, who had been diagnosed with bipolar disorder and paranoid schizophrenia, was off his medication and poking holes in his leg "to let the air out," his sister, Jinia Armstrong Lopez said in a complaint filed in May 2013.

Lopez said she took her brother to Moore Regional Hospital in Pinehurst, N.C., but when he was being evaluated, he became frightened and ran from the emergency room.

The doctor determined at the time that he was not a danger to anyone else, only a danger to himself, and he began drawing up involuntary commitment papers to force his return.

The Pinehurst police department was called, and Lt. Jerry McDonald, Sgt. Tina Sheppard and officer Arthur Gatlin Jr. arrived at the scene to bring Armstrong back to the hospital.

The officers first tried to talk to Armstrong, but he was acting erratically, eating grass and dandelions and putting cigarettes out on his tongue while the officers waited for the commitment order. He was also straying close the busy highway.

Once the papers were complete, the three officers surrounded Armstrong, who by then had sat down on the ground and wrapped himself around a post. They tried to pry his arms and legs free, but he was holding on too tightly. Two police officers joined them, and Armstrong's sister was standing nearby.

Within moments of the commitment order being finalized, the complaint said, Officer Gatling drew his Taser and warned Armstrong that if he didn't let go of the post, the device would be used on him. Armstrong refused, and Gatling Tased him five separate times over a period of just two minutes.

The other officers joined in the struggle, and finally were successful in prying Armstrong from the post, laying him face down on the ground.

During the struggle, Armstrong said he was being choked, but no independent witness saw the police apply any chokeholds. Lopez said she saw the officers "pull his collar like they were choking him," during the struggle, the Fourth Circuit's ruling said.

Bloomberg via Getty Images An electronic weapon manufactured by Taser International.

The officers applied handcuffs and shackled his legs, the ruling continued. At this point, he was no longer moving. Lopez was the first to notice that her brother was unresponsive. The officers turned him over and saw that his skin had turned a bluish color, and he didn't appear to be breathing.

They administered CPR, and he was transported to the emergency room where he was pronounced dead shortly after admission. Just six and a half minutes had elapsed between the dispatch advising the police officers that Armstrong's commitment papers were final and their radioing for Emergency Medical Services.

Lopez sued the police officers for use of excessive force in violation of Armstrong's Fourth and Fourteenth Amendment rights. Judge Eagles ruled that "it is highly doubtful that the evidence establishes a constitutional violation at all, but assuming it does, the defendants are entitled to qualified immunity."

Qualified immunity protects officers who commit constitutional violations but who, in light of clearly established law, could reasonably believe that their actions were lawful.

Two inquiries must be made to establish qualified immunity: that the plaintiff has had his constitutional rights violated and whether that right was clearly established at the time of the alleged violation.

The court determined that Armstrong's constitutional rights were violated because he was no danger to anyone but himself. While some force was justified because he was not complying with police orders and they needed to prevent him from running into the street where he could have hurt others, excessive force was not warranted.

Writing for the Fourth Circuit panel, U.S. Circuit Judge Stephanie Thacker agreed.

"The degree of force necessary to prevent an individual who is affirmatively refusing to move from fleeing is obviously quite limited," Thacker wrote. "Immediately Tasing a non-criminal, mentally ill individual, who seconds before had been conversational, was not a proportional response."

The panel felt the officers could have eventually seized Armstrong without Tasing him. This use of force was excessive and in violation of Armstrong's rights, it said.

However, panel upheld the lower court's grant of summary judgment in the officers' favor because they were entitled to qualified immunity, which is based on the fact the officers did not understand at the time that they were violating his rights.

Thacker wrote that the officers "were treading close to the constitutional line," but they did not continue to use force after Armstrong was secured, and they did give him prior warning.

Given established cases that allow for force in non-violent situations, the officers "did not have sufficiently clear guidance to forfeit qualified immunity," she wrote.

The court recognized that use of Tasers in non-violent situations is evolving, which is why qualified immunity is available. However, the panel warned, "This ought not to remain an evolving field of law indefinitely."

In order to avoid greater "deteriorative creep," Thacker offered some further guidance, particularly that a Taser "may only be deployed when a police officer is confronted with an exigency that creates an immediate safety risk and that is reasonably likely to be cured by using the Taser.

"The subject of a seizure does not create such a risk simply because he is doing something that can be characterized as resistance - even when that resistance includes physically preventing an officer's manipulations of his body," she continued. "Erratic behavior and mental illness do not necessarily create a safety risk either. To the contrary, when a seizure is intended solely to prevent a mentally ill individual from harming himself, the officer effecting the seizure has a lessened interest in deploying potentially harmful force."

"Where, during the course of seizing an out-numbered mentally ill individual who is a danger only to himself, police officers choose to deploy a Taser in the face of stationary and non-violent resistance to being handcuffed, those officers use unreasonably excessive force. While qualified immunity shields the officers in this case from liability, law enforcement officers should now be on notice that such Taser use violates the Fourth Amendment," Thacker wrote.

This story was originally published by Courthouse News.

PHOTO GALLERY Intense Police Chases