A runner, a police officer and members of the Boston Marathon staff flinch as smoke rises from a bomb site. Photo: Reuters

The evil attack in Boston yesterday should be a reminder to all Americans not only of the dangers we face, but also of the mass murders we were strangely spared over the past decade.

Three months after 9/11, would-be shoe bomber Richard Reid was unable to light the fuse that would’ve blown up his plane — and 197 travelers and crew — over the Atlantic.

Eight years and three days later, on another plane, the Christmas Day bomber couldn’t detonate the plastic explosives he had hidden in his underwear. Had he succeeded, 290 people would have died over Detroit.

And in May 2010, on a busy Saturday night, Faisal Shahad drove a Nissan Pathfinder into Times Square loaded with gasoline and gunpower. Two street vendors saw smoke pouring from the vehicle on 45th street and alerted the cops; had the gasoline caught fire, hundreds or thousands might’ve been injured and killed.

In each of these cases, an inexplicable combination of luck, incompetence and attentive bystanders helped prevent mass casualties.

And perhaps because these strangely fortuitous results have been the rule rather than the exception since 9/11, we might have grown emotionally unprepared for what happened yesterday — a planned terror assault involving improvised explosive devices and remote detonators.

Whether the person (or persons) who perpetrated this unspeakable evil was a home-grown extremist or an operative of a foreign terrorist group, he has plunged us instantly back into a past none of us has ever wished to revisit.

All Americans had a heightened sense of danger and threat after the 2001 attacks. That sense was exacerbated in the months following the destruction of the Twin Towers not only by the shoe bomber but also the anthrax envelopes sent to this paper and others, as well as unrelated events like a plane crashing in the Rockaways two months after and the Washington sniper shootings the next summer.

But the followup acts of terror everyone expected did not materialize, at least not here. What we thought might happen on our shores instead happened in Madrid in 2004 and in London in 2005.

That was no accident. This country mightily inconvenienced itself and its citizens as it took extraordinary measures, from airports to office-building lobbies, to make things harder for those who would use the country’s openness against it.

We complain about them mightily, but who knows how many possible attacks were simply dropped because the planners had no assurance they could make it through airport security?

And the homeland-security regime we created after 9/11 has been demonstrably effective. According to NYPD chief Ray Kelly, the Times Square bomber admitted he hadn’t used the kind of bomb-making materials that might have worked more effectively because he was afraid that buying incendiary ammonium nitrate would attract attention from homeland-security authorities.

At the same time, we’ve found ourselves and our national political life afflicted by a different sort of inexplicable threat — this one from the lone-wolf armed psychotic with an insane private agenda committing mass murders on college campuses, in schools, at a supermarket, at a movie theater.

We’ve been trying to make sense out of this senselessness and what to do about it, even as we’ve had an implicit national sense that we had the other threat, the terrorist threat, in hand.