The city is gripped by a gun-violence epidemic, but only about 20 percent of shootings have ended with an arrest, according to a Post analysis of NYPD data through late August.

Of the approximately 1,000 cases of gunplay tallied, about 210 have seen at least one suspect arrested, with the rest remaining open as of late last month, according to data The Post obtained from the city’s five district attorneys when the NYPD repeatedly refused to provide it themselves.

Historically, the NYPD’s so-called shooting clearance rate has hovered around 30 to 33 percent, department officials have said.

NYC WOMAN, 74, PUNCHED IN FACE AFTER TEENS SNATCH PURSE, POLICE SAY

A shooting is considered “cleared” when cops make at least one arrest.

Brooklyn has seen both the most shootings — around 440 as of Aug. 23 — and the fewest resulting arrests, with around 70 busts, good for a roughly 15-percent clearance rate, the data shows.

Staten Island cops have cleared approximately half of the borough’s shootings, though that incident count was only around 30 as of Aug. 30, according to figures from Richmond County prosecutors.

Of the other three boroughs, each of which had more substantial sample sizes, Manhattan fared the best, with about a 26-percent clearance rate on its more than 130 shootings as of Aug. 23.

The Bronx had a roughly 23-percent clearance rate on its approximately 250 shootings, nearly even with Queens’ 22-percent clearance rate on about 145 shootings, as of Aug. 30 and Aug. 23, respectively.

As gunplay has exploded across New York this year to levels not seen in decades, city and NYPD officials have alternately blamed prisoner releases due to state bail-reform and the coronavirus, the pandemic-forced closure of many courts and increased scrutiny on how cops do their jobs amid a wave of anti-police sentiment.

While Post investigations have debunked the first two explanations, Maria Haberfeld, a police science professor at the John Jay College of Criminal Justice, said that the third cannot be discounted.

“We cannot be ignorant of the fact that police are under a microscope,” she said. “[It] does not encourage the average officer to out of his her way clear the cases, because even when they do there are accusations of misconduct.”

Haberfeld noted that, nationally, a clearance rate around 40 percent is considered “very high and good.

“Clearance rates are low to begin with,” she said. “It’s not like the movies.

“I’m not saying it shouldn’t be higher,” Haberfeld continued. But “right now, I think there is a fear to arrest because there is a fear of almost secondary victimization.

“No matter what they do, it’s not going to be good for them or the department, [and it] impacts the way they do their job.”

In addition to those factors, the NYPD in July saw its budget significantly reduced due to the twin pressures of the coronavirus fiscal crunch and outcry over high-profile issues of police misconduct nationally.

In June, Commissioner Dermot Shea also disbanded the department’s gun-hunting plainclothes anti-crime unit, citing a number of operations that went south to troubling result.

“The NYPD’s commitment to gun suppression is undaunted even amid a perfect storm of unprecedented challenges,” said department spokeswoman Sgt. Jessica McRorie, noting that firearms busts are up in 2020 as compared to four of the past eight years.

McRorie went on to list a number of the issues with which the NYPD has been contending.

“Headcount is down, enduring attrition, the July recruit class was canceled, overtime has been significantly limited, and resources are strained from the ongoing COVID-19 outbreak, the continuing protests and the sustained increases in shootings that keep teams of officers tied to the scenes of violence for prolonged periods,” she said.

“Through it all, the men and women of the NYPD always answer the call — and will continue to do so — because they never give up.”