New York City was supposed to be the next big show for the Boston Marathon bombers, a sort of blood ballet in Times Square planned spontaneously by the two crazy guys from the Caucasus when they were on the run and out of luck like the hapless homicidal characters in some Quentin Tarantino movie.

That they’d put the Big Apple in their sights was no surprise for the New York City Police Department or New York Mayor Michael Bloomberg. "When you catch a terrorist and look at a map in his or her pocket," Bloomberg has said for years, "it is always a map of New York."

What did surprise Bloomberg and Police Commissioner Ray Kelly, according to well informed sources, was the delay of more than 48 hours from the time the Federal Bureau of Investigation first had this information confirmed to the time word reached responsible officials in Gotham. According to these same sources, not only was the NYPD kept out of the loop, so was the Joint Terrorism Task Force in New York, which includes NYPD detectives but is run by the FBI.

The feds may well have thought that the threat to New York was over. There were only two principal suspects: 26-year-old Tamerlan Tsarnaev, killed in a shootout, and his brother, 19-year-old Dzhokhar Tsarnaev, wounded but answering questions in a Boston hospital. But officials in New York want, and indeed demand, the right to make their own threat assessments.

As Commissioner Kelly explained when I interviewed him for my 2009 book Securing the City, until 2001 “there was an assumption that the federal government was taking care of business” and “that gave us, I think a false sense of security that we really had this threat under control.”

After the destruction of the World Trade Center on 9/11, it was clear the city had to do a whole lot more to protect itself. When Bloomberg started his first term at the beginning of 2002, with Kelly as commissioner, the NYPD’s marching orders were to do anything and everything that could be done within the law (including pushing the edges of that envelope) to keep the city safe. New York would do that with extensive federal support and cooperation when possible, but it assumed for itself primary responsibility for defending New Yorkers.

Today, officials concerned with New York’s security see the way the feds handled the Boston case as proof positive that the NYPD has to continue taking the initiative. Speaking publicly on Thursday, Bloomberg told the press, “The attacks in Boston—and the news that New York City was next on the terrorists’ list—shows how critical it is for the federal government to devote resources to high risk areas” (meaning New York above all). “It also shows just how crucial it is for the NYPD to continue to expand its counterterrorism capabilities and intelligence-gathering activities.”

Although Bloomberg and Kelly have gone on the record praising the federal government’s performance in the Boston case, the details of the investigation so far point to one big lucky break solving the case, and a lot of missteps before and after that break came.

The FBI and the CIA followed up on information supplied to them by the Russians in 2011 fingering Tamerlan Tsarnaev as a potential terrorist. But the federal agents did so in a way that alerted Tsarnaev to the investigation: they questioned him directly. At that point, he knew he was on their radar, and if he had not been radicalized before, resentment at that fact might have pushed him toward further extremism. Or it might have scared him away from radicalism. In any case, the FBI appeared to lose interest in him. It did not check on him or his activities when he returned last year from nearly six months in the Caucasus. And there is no evidence thus far that it tried to use a confidential informant or undercover agent to learn more about his activities.

In New York, the NYPD has come under scathing public criticism from civil libertarians (and frequent veiled criticism from retired FBI officials) for conducting extensive surveillance in areas where Muslim extremists congregate and agitate—or where they might hide out among more innocuous populations. Had Tamerlan Tsarnaev been living in the five boroughs, he might have come under close observation without knowing it. But the Boston Police Department, which is less than one-10th the size of the NYPD, does not have the resources to do that. So it depends on the FBI to take care of business. Clearly, in this case the FBI did not.

After the bombing, as The Daily Beast’s Michael Daly has pointed out here, you’d have thought some agent connected with the 2011 questioning of Tamerlan Tsarnaev would have recognized him from the pictures the feds pulled together of the two most likely suspects in the marathon crowd on Monday, April 15. Had that happened, authorities could have tracked down Tamerlan and Dzhokhar quite easily. They had returned to their everyday lives. But it seems no one in the FBI’s Boston Field Office recognized Tamerlan from the photos.

And we now know that the public release of those images on Thursday, April 18, tipped off the suspected bombers that the authorities were after them. As a direct result, they killed an MIT policeman and tried to steal his pistol and started on their final drive toward death.

At about 11 that Thursday night, the Tsarnaevs allegedly hijacked a leased Mercedes driven by a 26-year-old Chinese immigrant entrepreneur. The Boston Globe’s exclusive interview with that man, identified only as “Danny” because he hopes to remain out of the headlines, makes a strong case that it was his actions, motivated by a plausible combination of breathtaking fright and bravery, that created the crucial break in the case.

As reporter Eric Moskowitz points out, this was the true Tarantino moment in the bombing narrative, with “bursts of harrowing actions laced with dark humor and dialogue absurd for its ordinariness, reminders of just how young the men in the car were. Girls, credit limits for students, the marvels of the Mercedes-Benz ML350 and the iPhone 5, whether anyone still listens to CDs—all were discussed by the two 26-year-olds and the 19-year-old driving around [Boston and its suburbs] on Thursday night.”

The brothers had said they were the marathon bombers and that they’d shot a cop. We now know that the “luggage” they had moved from their old car to Danny’s included one pressure-cooker bomb and five smaller pipe bombs. They openly discussed driving to New York, but “Danny could not make out if they were planning another attack,” according to the Globe.

Fortunately for Danny—and for the rest of us—the Mercedes was very low on gas. When they stopped at an all-night Shell station, the brothers thought they could pay anonymously and quickly with one of Danny’s credit cards. But it was “cash only.” Dzhokhar had to go inside the station; Tamerlan put down his pistol for a minute to play with the Mercedes’ GPS system; and Danny plunged out of the car, sprinting for the safety of another service station, where he hid in a storeroom while the attendant there called 911. Danny told the police what had happened, and that they could track his car with its onboard satellite locator and also by tracing his iPhone 5, which he’d left in the Merc.

Shortly after that the bombers were cornered in Watertown, Mass. In the shootout, Tamerlan was shot and Dzhokhar ran over him while making his own escape. But the younger brother didn’t go far and the following night the cops found him hiding in a boat in someone’s back yard, bleeding profusely.

The FBI first questioned Dzhokhar the following night in the hospital. He could barely respond because of a bullet wound to his throat. He said that the brothers had intended to go to New York “to party.” But it wasn’t clear whether that meant a celebration or if it was his demented shorthand for another attempted massacre. From Sunday into Monday the feds questioned Dzhokhar in more detail, and he said the idea had been to take the bombs to Times Square, which he had visited last year, and to set them off there.

That information was not passed on to the NYPD until Wednesday night, which is the source of irritation at City Hall and One Police Plaza. It's also the source of some embarrassment, since on Wednesday morning Kelly had repeated the canard about the Tsarnaevs heading to New York "to party."

Officials familiar with the case say it does not appear the oversight was an intentional snub, although the bad blood between the NYPD and some members of the FBI goes back more than a decade. Rather, they say it appears that when the FBI’s central office in Washington took over this very high profile case, it brought in protocols and even computer systems that short-circuited the normal arrangements for information sharing.

Was New York endangered by this particular FBI oversight? In this case, if it turns out the Tsarnaevs really did act alone, then probably not. But it’s still not entirely clear that is the case. The feds and the NYPD Intelligence Division are continuing their investigations.

The NYPD had put its extensive counterterror resources on high alert from the first minutes after the bombs in Boston went off. But if Danny hadn’t escaped at that Shell station, it’s doubtful the Mercedes would have been traced in time to stop it from driving to New York. It would have arrived around 2:30 or 3:00 in the morning, as Commissioner Kelly has pointed out. There would have been plenty of cops around, and plenty of civilians, too, in the city that never sleeps. The Tsarnaev brothers might well have had the bloody finale they were looking for in Times Square.

If they have friends who want to do the same, one can only hope that all the law enforcement agencies tracking them share that vital information.