The malfunctioning subway cameras that failed to capture images of the gunman who opened fire on a Brooklyn subway earlier this year were down for four days prior to the attack, according to a new report that identified “significant problems” in the transit agency’s oversight of its camera system.

MTA officials previously admitted that three of its subway cameras had malfunctioned during the shooting, scrambling efforts to capture the alleged shooter, Frank James, who police said wounded 10 people after shooting up a rush-hour N train at the 36th Street Station.

The scope of that failure was underscored Thursday in a report from the MTA’s Office of the Inspector General, which highlighted the agency’s “confusing and inadequate” response protocols, as well as lengthy delays in fixing the problems even after they were identified.

The inquiry found the network of cameras – along 25th Street, 36th Street, and 45th Street in Sunset Park – went down on Friday, April 8, four days prior to the Tuesday morning shooting. The cause of the failure remains unknown.

But while the MTA claimed to have built redundancies into its system, the outage was not flagged for the MTA’s Network Group, which maintains camera equipment, until Monday, April 11. Along the way, several employees from other MTA subagencies were sent on failed missions to restore the cameras, which were still not functioning properly during the attack.

When a switchboard operator noticed the feeds were down, he alerted the MTA’s Trouble Ticket System – an inbox that “no one” from the Network Group is tasked with monitoring, according to a senior manager who spoke to the inspector general. Instead of fixing the problem, the signal failure alarms coming from the broken cameras were “muted,” the report found.

“[S]hortfalls in staffing, maintenance and internal controls – along with a breakdown of communication – significantly delayed both the discovery that the video was not streaming in the days prior to April 12 and then the eventual repair of the network,” wrote Elizabeth Keating, the MTA’s acting inspector general.

Those breakdowns appeared to hinder the effort to detain James, who remained at large for 24 hours after the shooting, strolling through several Manhattan hotspots before he was detained.

In a letter responding to the inspector general, New York City Transit President Richard Davey pushed back on the report’s findings, pointing out that “99.6% of the streaming cameras were operating” on the morning of the shooting.

The recommendations issued by the inspector general – such as increasing staffing levels, preventative maintenance and training – represented “business decisions” that would require “reducing investment” in other areas, according to Davey.

“Prioritizing the acceleration of the repair of the 1% of our cameras that are out of service at any time comes at the expense of other train and bus service-sensitive activities,” he wrote.

Over the last two decades, the MTA has blanketed the subway system with more than 11,000 cameras, spending more than $1 billion on the effort. Roughly half of the cameras capture livestreaming video footage, which is transmitted to both the NYPD and MTA police.

Civil liberties advocates have raised concern about the surveillance expansion, while other experts have questioned their usefulness in reducing crime.

But at a City Council hearing earlier this week, Michael Kemper, the NYPD’s acting chief of transit, praised the role of the camera network in helping to solve cases underground.

“If we need a source of video, we have access to that video almost instantaneously,” Kemper said. “We use it all the time. These videos solve cases, big cases, and by solving these cases with the video, we are preventing new cases from happening.”