New York City has shelled out $384 million in taxpayer funds to settle cases of police misconduct over the past five years — and more than half of the suits brought against officers didn’t even go to trial, a Post analysis has found.

Some of the settled cases involved allegations of wrongful imprisonment or police brutality.

But others were seemingly nuisance suits of the kind that Mayor Bill de Blasio vowed in January 2015 to crack down on.

Hizzoner said then that he would aggressively challenge “ambulance-chasing lawyers” who “try to make a buck by gaming the system.

“The court process is long, it’s complicated, it’s costly. But we’ll do that to send a clear message that this has got to stop,” he said.

Several lawyers who regularly file misconduct suits against the NYPD said de Blasio’s edict has led the city’s lawyers to take a tougher stand during negotiations.

But data made public by the city Law Department show the city still struck 530 settlements for $5,000 or less, amounts that plaintiffs’ lawyers described as payments to make “nuisance” cases go away without litigation.

Civil rights lawyer and Pace Law School Professor Randolph McLaughlin — who scored a combined sum of more than $8 million for two men shot by a drunken off-duty cop — said payments in the low four figures were typical for “low-level” misconduct allegations that don’t involve violence or witnesses, such as “a little disrespect, just pushing and shoving.”

In the past five years, the city settled more than half of the 11,404 suits brought against it, giving settlement payouts to approximately 5,800 people.

A majority of the settlements — more than 3,000 — involved payments ranging from $5,001 to $25,000 each, which lawyer Jeffrey Rothman said could cover getting locked up on charges that were later dismissed.

“There’s a basic understanding that, for a night in jail, it’ll be approximately $20,000 — sometimes less and sometimes more,” said Rothman, who filed 64 cases tallied by the Law Department.

And while the city has been driving harder bargains since de Blasio’s pledge, lawyer Eric Siegle, whose firm struck 36 settlements worth a total $3.4 million, said the city’s refusal to make quick deals has also backfired on taxpayers because cops “usually don’t ’fess up to the city lawyers as to what really happened in the case.”

“When we go through discovery, our cases get so much better and so much stronger,” Siegle said.

“We’re getting more money later on — much more than we would have maybe taken at early settlement,” Siegle said, “because the egregious conduct of the police officers that we’re discovering through going the litigation process is much worse than we even anticipated.”

Lawyer Joel Rudin — who last year landed $2.5 million for an ex-Crips gang member who was wrongly convicted of killing a member of the rival Bloods gang — said he understood why the city’s attorneys would challenge legal claims “that they feel are without merit.”

“The problem is that when lawyers bring cases that do have merit, they fight them, too,” Rudin said.

While the majority of settlements was for comparatively small sums, a handful of payments of $1 million or more accounted for nearly $190 million of the total paid out by the city.

Many of those 37 cases involved plaintiffs who had spent decades in prison for wrongful convictions.

The biggest payments, of $13 million each, went last year to Antonio Yarbough and the estate of Abdul Shariff Wilson, who were convicted of stabbing and strangling Yarbough’s mother, his 12-year-old half-sister and the girl’s friend in the family’s Coney Island apartment in 1992.

Both men were freed after DNA testing in 2013 tied fingernail scrapings taken from Yarbough’s mother, Annie, to a still-unidentified male suspect in another slaying in Brooklyn in 1999 — which took place while both Yarbough and Wilson were behind bars.

The men were released in 2014, but Wilson died less than a year later of respiratory problems that his lawyer blamed on his time in prison.

In December, the city also agreed to pay $12.25 million to Andre Hatchett, who was convicted in the fatal 1991 beating of a woman whose body was dragged into a Bedford-Stuyvesant park and posed, naked, as if she’d been crucified — even though Hatchett had a cast on his leg at the time and needed crutches to get around after he was shot the year before.

Hatchett served 25 years in prison — more than half his life — before being released in 2016 at the age of 49 following a review of his case by the Brooklyn District Attorney’s Office.

More recent cases include the wrongful death of Eric Garner from an illegal police chokehold on Staten Island in 2014, and the accidental police shooting death of Akai Gurley in a Brooklyn housing project later that year. Their estates received $5.9 million and $4.5 million, respectively.

At the low end of the scale, the city in March paid $350 to Richard Porrazzo, who used fill-in legal papers to file suit in Manhattan federal court against “Detective Rogers” and other unidentified cops over claims that he was falsely charged with a Bronx burglary while serving time in the Putnam County Jail for violating probation.

In August 2014, Patrolmen’s Benevolent Association president Patrick Lynch sent a letter to city Corporation Counsel Zachary Carter and then-Police Commissioner Bill Bratton complaining about the “cottage industry” of filing baseless suits against the NYPD.

“Getting paid to sully the reputation of the officer who arrested you for breaking the law is almost too good to resist,” Lynch wrote.

Nothing came of the union chief’s gripe until the controversy exploded the following January, when The Post published a Page 1 exposé about $5,000 paid to Ruhim Ullah of Brooklyn, who sued over getting shot in the leg by a cop in 2010 — which the NYPD said happened when he refused orders to drop an 18-inch machete.

Ullah, now 27, has since been busted four more times, and currently is facing charges in the July 21 theft of two 24-ounce bottles of Corona Extra beer from a 7-Eleven store on the Lower East Side.

The data were quietly made public under terms of Local Law 166 of 2017, which de Blasio signed in September.

The legislation requires the Law Department to post on its website, twice a year, information about all suits filed against the NYPD during the preceding five years.

The Post found the online spreadsheet riddled with errors, including no entry for a $2.5 million settlement struck in 2014 with Sol Cecilia Reyes over the fatal police shooting of her son, Noel Polanco, during a 2012 traffic stop on the Grand Central Parkway in Queens.

The law covers only suits filed within the five-year period. So if one is filed previously but later settled, there is no record of it in the spreadsheet.

This includes the $41 million 2014 settlement with five exonerated men in the 1989 rape of a female jogger in Central Park and last year’s $75 million deal to settle a class-action suit alleging that cops issued 900,000 bogus summonses to meet quotas, because those cases were filed before the earliest date in the spreadsheet.

Also not covered — or listed — is a slew of hefty settlements arranged by city Comptroller Scott Stringer before any suits were filed over the cases.

Some involve crimes investigated by disgraced former Brooklyn Detective Louis Scarcella, who is suspected of fabricating evidence in about 50 cases.

The data show that misconduct suits filed against the NYPD have declined steadily from 3,075 in fiscal 2014 to 1,483 in fiscal 2018, a drop of nearly 52 percent.

When the numbers first started falling, experts pointed to the city’s record drop in crime — which has dramatically reduced interactions between cops and suspects — and to de Blasio’s rollback of the NYPD’s use of the stop-and-frisk policy shortly after taking office.

Stringer has also taken credit for preventing suits against the NYPD by negotiating settlements following the filing of notices of claim with his office, which is a prerequisite for suing the city.

A City Hall spokeswoman said that since 2016, when she said de Blasio’s policy went into effect, the number of suits against the NYPD that went to trial increased by 30 percent, showing the city is trying to get tough on frivolous claims.

“While the number of lawsuits continues to decline, we’re taking more cases to trial than ever before to fight for officers,” Hizzoner’s deputy press secretary, Olivia Lapeyrolerie, wrote in an email. “We’ve improved the city’s fact-finding process, filed more motions to dismiss cases and added resources and personnel to reduce settlements.”

Additional reporting by Stephanie Pagones