NEW YORK -- With the runners ready but ravaged residents still recovering from Sandy, this weekend's New York City Marathon was canceled Friday when Mayor Michael Bloomberg reversed course and yielded to mounting criticism that this was no time to run a race.

The death toll in the city stood at 41 and thousands of shivering people were without electricity, making many New Yorkers recoil at the idea of assigning police officers to protect a foot race and evicting storm victims from hotels to make way for runners.

Bloomberg, who as late as Friday morning insisted that the world's largest marathon should go on as scheduled Sunday, changed course hours later after intensifying opposition from the city controller, the Manhattan borough president and sanitation workers unhappy that they had volunteered to help storm victims but were assigned to the race instead. The mayor said he would not want "a cloud to hang over the race or its participants."

"We cannot allow a controversy over an athletic event -- even one as meaningful as this -- 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," the mayor said.

Around 47,500 runners -- 30,000 of them out-of-towners, many of them from other countries -- had been expected to take part in the 26.2-mile event, with more than 1 million spectators usually lining the route.

The race had been scheduled to start in Staten Island, one of the storm's hardest-hit places, and wind through all of the city's five boroughs. The nationally televised race has been held annually since 1970, including 2001, about two months after the 9/11 terrorist attacks.

For runners, the cancellation was a devastating disappointment.

At the midtown New Yorker Hotel, the lobby was filled with anguished runners, some crying and others with puffy eyes. In one corner, a group of Italian runners watched the news with blank looks.

"I have no words," said Roberto Dell'Olmo, from Vercelli, Italy. Then later: "I would like that the money I give from the marathon goes to victims."

Elsewhere across the metro area Friday, the recovery made slow progress. Companies turned the lights back on, and many employees returned to their desks. Many major retailers also reopened.

But patience was wearing thin among New Yorkers who had been without power for most of the week.

Gov. Andrew Cuomo told utilities to step up power repair work or risk losing business in the state. And officials said the cost of the storm could exceed $18 billion in New York alone.

From storm-scarred New Jersey to parts of Connecticut, a widespread lack of gasoline frustrated people who were just trying to get to work or pick up a load of groceries.

Lines of cars, and in many places queues of people on foot carrying bright red jerry cans, waited for hours for precious fuel. And those were the lucky ones. Other customers gave up after finding only closed stations or dry pumps marked with yellow tape or "No Gas" signs.

Bloomberg called the marathon an "integral part of New York City's life for 40 years" and insisted that holding the race would not require resources to be diverted from the recovery effort. But, he said, he understood the doubts.