In a dramatic turn Thursday, a judge declared a mistrial in the case of three reputed gang members charged with gunning down former Narbonne High School basketball star Shailo Leafa after a juror changed her mind, saying she felt “peer pressured” to convict.

The ruling in Long Beach Superior Court came about an hour after a clerk read guilty verdicts for one of the accused gunmen, David Lee Allen.

When the clerk asked jurors one-by-one if their verdicts were true, the woman paused, dropped her forehead in her hand and said, “No,” stunning the courtroom.

Jurors told Judge Judith L. Meyer that after two days of deliberating, all 12 had voted that afternoon to convict Allen of one count of murder and two counts of attempted murder. They had just moved on to discussing counts against another defendant when the woman became distraught and requested an alternate juror take over for her, they said.

It appeared there was confusion over whether that meant she had changed her mind about Allen.

Meyer said the juror seemed to have a “mental breakdown,” but that because she made it clear she could not agree, there was no choice but to declare a mistrial.

Allen, 32, Khalif Ferguson, 34, and his cousin, Jasper Ferguson, 25, are accused of spraying Leafa and two friends with bullets as they sat in the parking lot of the Sahara Hookah Lounge in Harbor City on the evening of March 5, 2014.

Leafa died at a hospital, Che Potasi survived his injuries and Miles Mageo managed to escape the gunfire.

For months, Leafa’s grieving family put up a billboard near the strip mall on Western Avenue and Pacific Coast Highway with his photo pleading for tips.

On Thursday, disappointment visibly set in as they walked out of the courtroom. They sat through the two-week trial.

“It’s very upsetting,” said Neise Leafa, Shailo’s mother. “This is not what we expected, we thought it was an open-and-shut case. We’ll keep pushing forward.”

Deputy District Attorney Keith Duckett declined to comment on the ruling, as did defense attorneys.

According to the prosecution, the three alleged killers, who are part of the Harbor City Crips, carried out an ordered ambush on Leafa and his friends following a confrontation at a nearby gas station with another member of the Harbor City Crips who asked the group, “Where you from?”

One of Leafa’s friends claimed membership with a rival gang, according to court testimony, and a gun was flashed.

Detectives said Leafa was not a gang member, but the friends belonged to rival gangs. The hookah lounge falls in Harbor City Crips territory.

“They angered the wrong people in the wrong area and they were targeted,” Duckett said Tuesday during closing arguments. “These three individuals came, scoped them out and decided they should die.”

Two years passed before Los Angeles Harbor Division detectives arrested Allen and the Ferguson cousins. An anonymous tip identifying the suspects was traced to Jasper Ferguson’s ex-girlfriend, who gave detectives information in exchange for protection for her family, Duckett said.

She took the witness stand during the trial.

So did Potasi, who claimed he was shot, but that he did not remember anything else.

But in recorded interviews played for jurors, Potasi gave detectives an account of the confrontation at the Chevron station.

Jurors also heard jail calls in which Jasper Ferguson allegedly tried to pay off Potasi in exchange for him testifying that he was not involved.

They heard recordings of conversations between Allen and a jailhouse informant posing as a fellow gang member.

In one, Allen allegedly told the informant that after the gas station confrontation, he and his co-defendants “got the ordering to go over there make something happen” that night.

“That (expletive) was fun,” Allen allegedly said.

Although the jury had voted to convict him of the felony charges and gang enhancements, they did not find allegations that he discharged a handgun to be true.

Prosecutors said Allen’s 9 mm handgun jammed before he could fire any rounds, something he allegedly admitted to the informant.

Defense attorneys dismissed the recordings as “jabbering in a jail cell” and stressed that no physical evidence tied the defendants to the shooting. They noted that the only guns found stashed in a trash can at the crime scene belonged to the victims. Police said the weapons did not match bullet casings on the ground.

The defense also cast doubt on the ex-girlfriend’s testimony, saying she was motivated by two custody battles, including one with Jasper Ferguson, and told detectives what they wanted to hear in exchange for help in court.

Duckett denied that the ex-girlfriend sought a $25,000 reward for information when she left the tip.

Jasper Ferguson’s attorney, Jonathan Rosen, said Duckett was wrongly asking jurors to find the men guilty “with no eyewitness, no hard evidence, no fingerprints or DNA, just what somebody said.”

Attorneys will return to court next month to discuss a new trial.

If convicted, the trio face up to 25 years to life in prison.