In a union hall lobby in Waterloo, Iowa, Mayor Bill de Blasio slouched down into a corner, his presidential stump speech safely delivered, but with a more pressing issue at hand.
About 1,000 miles away, large swaths of Manhattan’s West Side were still enveloped in darkness by a massive power failure, and Mr. de Blasio had to decide whether to immediately return to New York. He did not have enough information, he told reporters in Iowa on Saturday, and would decide later.
As Mr. de Blasio dithered, others in New York stepped in.
Corey Johnson, the City Council speaker, gave frequent updates on Twitter regarding the scope of the blackout. Mr. Johnson had been in Long Island when the blackout started, but returned to the city after the news broke.
A news conference held in the Upper West Side was attended by numerous elected officials, including the city comptroller, Scott M. Stringer; the public advocate, Jumaane D. Williams; and the Manhattan borough president, Gale A. Brewer.
From Albany, Gov. Andrew M. Cuomo deployed 200 state troopers and 50 light towers to the blackout area, and directed the Public Service Commission to investigate the cause of the power failure. By night’s end, Mr. Cuomo was in the city, touring the substation believed to be the cause of the problems, with the Con Edison chief executive, John McAvoy.
By then, Mr. de Blasio had decided to return, leaving for a four-hour car ride from the Iowa union hall in, of all places, Waterloo. He arrived in Chicago at 1 a.m. Sunday, and flew back to New York hours later.
The episode, much like a police-involved shooting of a black man in South Bend, Ind., did for Mayor Pete Buttigieg, illustrated the challenges faced by mayors who take leave of their cities to launch presidential bids.
That challenge is more fraught for Mr. de Blasio, who is at near zero in most polls but continues to campaign in states like Iowa, where he brought his son, Dante, and in South Carolina, where his wife, Chirlane McCray, was this weekend.
“I want people to understand that in this job and any public C.E.O. today, you have to take charge wherever you are and I did that,” Mr. de Blasio said at a news conference in Manhattan on Sunday. “In terms of the decision, as soon as it became clear that we did not have an immediately resolvable crisis, I started moving.”
But the mayor’s absence, as well as his initial indecision, came under heavy criticism on social media, and was alluded to by fellow Democrats, including Mr. Cuomo, who has often feuded with the mayor.
“Mayors are important,” Mr. Cuomo said in an interview on Saturday on CNN. “Situations like this come up and you have to be on site, I believe that.”
“I’m governor of New York, I have been for eight years,” he added. “I can count the number of times I leave the state, basically on my fingers.”
Mr. Williams, the public advocate, said that he “felt during a situation like that, the city deserved to see their government present,” adding that he was “ready to step in,” if necessary. “It exposes the difficulties of being the mayor of New York City and applying for another job,” he said.
Mr. Stringer praised emergency management officials and the mayor’s staff but said Mr. de Blasio’s presence was missed during the meeting with emergency management officials.
“When the mayor walks in the room, he or she is the one charge,” Mr. Stringer said. “It is just better when the guy in charge is in the house.”
Mr. de Blasio has spent at least a month traveling around the country since he announced that he was exploring a run for president earlier this year. He formally announced his candidacy in May. He stepped up his travels in early July, campaigning in Chicago, Houston, New Orleans, Iowa and South Carolina.
So far, Mr. de Blasio has avoided having to deal with a major crisis while he was out of town, but there have been close calls. In February, when he was still exploring a run for president, Mr. de Blasio canceled a trip to New Hampshire after a veteran New York Police Department detective was killed while responding to a robbery.
That decision was apparently more clear-cut than the one he faced on Saturday. At first, the mayor was told by officials that the blackout was limited to about 20,000 customers and a relatively small area. An hour later, that number had doubled.
By 9:30 p.m., Mr. de Blasio was getting reports that 72,000 customers were affected.
“Once he learned that this was going to be a bigger problem than originally thought, he made the decision to come back to New York,” said Freddi Goldstein, Mr. de Blasio’s press secretary.
But there were no immediate flights available in Iowa, so Mr. de Blasio was driven 300 miles to Chicago. Even so, Mr. de Blasio was not able to board a flight back to the city until Sunday morning.
Chris Coffey, who leads the New York practice for Tusk Strategies, a political and strategic consulting firm, said the mayor may have alienated New York voters who “tuned in and saw a really active” Mr. Johnson and Mr. Cuomo, while Mr. de Blasio was shown being interviewed from Iowa.
“I don’t know if that matters if you’re a voter in Iowa and New Hampshire, unless there is a perception that comes from the blackout and ICE raids that he’s not governing his city,” Mr. Coffey said.
Stu Loeser, a former press secretary for Mayor Michael R. Bloomberg, who spent time defending Mr. Bloomberg from criticism of regular weekend trips to Bermuda, including one when a snowstorm was approaching the city, wasn’t so sure.
“The police did their job, transportation officials did their job and Con Edison did their job,” Mr. Loeser said. “And life returned to normal.”
Reid Epstein contributed reporting from Waterloo, Iowa.