(CNN) Florida police officers can justify using deadly force and seek immunity from prosecution through the state's "stand your ground" self-defense law just like anyone else in the state, the Supreme Court of Florida recently ruled.

The immunity is a key feature: "Stand your ground" lets judges declare someone immune from prosecution if they find certain facts in favor of the killer in pretrial hearings, avoiding trial altogether in a disputed shooting.

Police officers already had been able to claim justification through a police-specific self-defense law, but in a disputed killing, those arguments had to be carried to trial.

"Law enforcement officers are eligible to assert Stand Your Ground immunity, even when the use of force occurred in the course of making a lawful arrest," the state's high court wrote in its 7-0 decision on Thursday.

One officer's attorney said the decision is groundbreaking and will let Florida law enforcement officers work with less fear of wrongful prosecution. An opposing attorney in the case called the result a travesty and warned it gives a judge too much power to dismiss even cases where grand juries decide an officer should be charged.

The 2013 shooting

The ruling involves a 2013 shooting in which a Broward County sheriff's deputy killed a black man he said pointed a weapon at him, a weapon that turned out to be an unloaded air rifle.

A grand jury indicted Deputy Peter Peraza with manslaughter, punishable by up to 30 years in prison, for the death of Jermaine McBean, a 33-year-old information technology engineer.

Here's what led to the shooting: McBean had bought an air rifle at a pawn shop and carried it, unloaded, as he walked back to his Oakland Park apartment complex, according to court documents. His family contends the air rifle was in a plastic bag, but the bag blew off as he walked home.

Jermaine McBean stands with his grandmother at his graduation in June 2007 at New York's Pace University.

Someone called 911 to report McBean walking around with what appeared to be a gun. Peraza and two other deputies arrived behind him and commanded him to stop, but McBean kept walking. His family said he kept walking because he was wearing ear buds and listening to music.

What happened next is in dispute.

In a pretrial evidentiary hearing, a judge found that McBean, after walking into his apartment complex with the deputies still behind him, brought the air rifle over his head, turned toward the deputies and pointed the gun at them.

Peraza, perceiving the rifle was being aimed at him, fired his gun three times and shot McBean twice, killing him, the trial judge found.

His family, citing at least one witness, contended that McBean never pointed the gun, but rather always had the gun cradled in his arms behind his head, across his shoulders, while the officers were behind him. The gun still was cradled in this way when McBean was shot as he turned to see what was happening behind him, the family contends.

The trial judge rejected the witness' testimony, and resolved factual disputes in favor of Peraza's arguments of self defense.

The case never went to trial because Peraza argued, and the judge agreed, that he should be granted pretrial immunity through Florida's "stand your ground" self-defense law.

Difference between 'stand your ground' and police self-defense

The "stand your ground" law says "a person" is justified in using deadly force if he or she reasonably believes it is necessary to prevent imminent death or great bodily harm, or to prevent a forcible felony.

And, the law says, the person using deadly force does not have to retreat, and indeed has the "right to stand his or her ground" if he or she "is not engaged in a criminal activity and is in a place where he or she has a right to be."

Critically in Peraza's case, someone found to be using deadly force consistently with that law is generally " immune from criminal prosecution and civil action ," Florida statutes say. For a prosecution to happen, a prosecutor has to provide "clear and convincing evidence" the shooter is not entitled to this immunity.

Florida law also provides a self-defense case for police specifically. It says officers can use any force they reasonably believe to be necessary to defend against bodily harm while making an arrest.

The police law also says officers don't have to retreat from efforts to make a lawful arrest because of resistance.

But the police-specific law doesn't allow pretrial immunity from prosecution when facts are in dispute.

When the trial judge granted Peraza immunity, the state appealed, arguing Peraza's wasn't eligible for "stand your ground" immunity because police have their own justifiable-force law.

Florida's Fourth District Court of Appeals sided with Peraza, but noted that a different appeals court previously ruled against a different police officer's claim. So, the Fourth District asked the Florida Supreme Court to resolve the issue.

That led to Thursday's ruling.

"Put simply, an officer is a 'person,' whether on duty or off, and irrespective of whether the officer is making an arrest," Florida Supreme Court Justice Alan Lawson wrote, referring to who the "stand your ground" statute covers as written.

'Groundbreaking' for police, lawyer says

Peraza's attorney, Eric Schwartzreich, said this is the first time a police officer has successfully used "stand your ground" in defense of a manslaughter or homicide allegation.

"I think it is groundbreaking," Schwartzreich said. "This allows police to go to work without fear that they're going to be indicted (wrongfully)."

He said Peraza "never should have been indicted." Peraza was suspended after his indictment, but has been back at work with the sheriff's department since the Fourth District appellate decision.

Thursday's ruling won't eliminate the use of the police-specific law, said Jeffrey Swartz, a former Florida judge who now is a law professor at the Tampa Bay campus of Western Michigan University's Cooley Law School.

"Reliance on (the police self-defense law) to justify the actions of the officer in the initial investigative and charging decision stages will still play an important role," Swartz wrote to CNN in an email. "Officers, their counsel and the unions that support them will still argue to state attorneys and investigators the facts of the case to prevent the charges being brought in the first place."

If an officer is charged, and if a court denies "stand your ground" immunity and the officer must go to trial, "the use of (the police-specific law) in conjunction with self-defense theories will still be relevant," Swartz wrote Friday.

A critic of the "stand your ground" law, University of Miami law professor Mary Anne Franks, said the high court's ruling itself was not surprising, because the law affords immunity to any "person" acting in self-defense, and police officers indisputably are people.

But, she wrote in an email to CNN on Friday, the ruling "only lays bare the heart of this problem: It overwhelmingly serves the interest of those who already have the law on their side."

"It is clear, after more than a decade of 'stand your ground' in Florida, that the law is affirmatively evil," she wrote. "It encourages people, including police officers, to use deadly force as a first rather than a last defense, with entirely predictable consequences: a steady increase in preventable and unnecessary deaths and a culture of cowardice and impunity.

"Police officers already kill members of the public, and particularly minority men, at alarming rates, with little or no consequences. The last thing they need is more encouragement to do so."

The Florida Attorney General's Office didn't immediately respond to CNN's requests for comment on the ruling.

'An absolute disgrace'

McBean's family is pursuing a civil lawsuit against Peraza, the two deputies who were with him and the county sheriff in federal court. The suit argues in part that McBean couldn't hear the deputies' commands because he was listening to music, that he didn't point the air rifle, and that he was wrongfully shot.

The family attorney, David Schoen, said Peraza's immunity from criminal prosecution "is an absolute disgrace."

Schoen said the indictment should have led to a criminal trial. In the 30 years preceding the case, more than 160 people had been killed by police officers in Broward County, but no officer had been indicted.

Peraza's indictment shows "how serious and how clear-cut this case was," Schoen said.

He noted that the Florida Supreme Court, in upholding the immunity, was bound by the trial judge's determination of facts.

Leaving such decisions in one judge's hands without a trial is dangerous, he said.

"The implications are huge. It's a slap in the face to every honest police officer," Schoen said. "If ... the grand jury hears all the evidence and indicts him, the case should go to trial. Let the trial jury decide if he's entitled to claim (a police officer's self defense)."