is an event tens of thousands of New Yorkers participate in and millions more watch," Bloomberg said in a statement.
"The marathon has always brought our city together and inspired us with stories of courage and determination. We would not want a cloud to hang over the race or its participants, and so we have decided to cancel it."
Bloomberg had strongly backed allowing the race to proceed on schedule on Sunday, despite the continuing clean-up in the wake of Sandy, which hit the east coast on Monday night.
But by Friday afternoon, while insisting that staging the race would not divert resources from those in need, Bloomberg acknowledged that the race had "become a source of controversy and division."
"We cannot allow a controversy over an athletic event... to distract attention away from all the critically important work that is being done to recover from the storm and get our city back on track," he said.
The decision was welcomed by James Oddo, a councilman representing Staten Island, one of the city's worst-affected boroughs.
"Proud of New Yorkers for ensuring we as a city did the right thing. Now lets redouble our efforts to help our friends and neighbors," he wrote on his Twitter account.
Among the 45,000 people scheduled to run, many of whom had expressed mixed feelings about participating in the race before it was cancelled, there was disappointment, but also sympathy for the decision.
"I am, of course, hugely disappointed to be this close to the starting line but not actually racing in 36 hours," Christina Wallace told AFP.
"That said, there is a lot we can do for our city this weekend instead of running 26.2 miles. I plan on donating blood tomorrow... then heading downtown to volunteer with the NYC food back on Sunday," she added.
"There will always be another race. I will get my marathon finisher's medal at some point."
Bloomberg's decision came after a barrage of criticism, which only sharpened as the race approached.
"The decision to move forward with the marathon is not a decision I would have made," city council speaker Christine Quinn, a Bloomberg confidante considered a frontrunner to replace him next year, said on Friday morning.
Those opposed to the race going ahead organized an online petition that had gathered more than 22,500 signatures by mid-afternoon Friday, calling for the race to be postponed until spring 2013.
And the New York Post dedicated its front page to the story, saying several generators that could power homes were being used for a marathon media center.
"The notion that so much as a flashlight battery would be devoted to a sporting event is outrageous," the paper said in an editorial.
At a press conference on Friday morning, Bloomberg had insisted the race should go ahead anyway.
"There will be no diversion of resources," he pledged. "The marathon's not going to redirect any focus."
He recalled his predecessor Rudy Guiliani's decision to proceed with the marathon after the September 11, 2001 attacks.
"I think Rudy had it right. You have to keep going and doing things, and you can grieve, cry, and laugh all at the same time. That's what human beings are good at."