“The problem was the event was put together way too late,” Mr. de Blasio said at his weekly news conference. “It was not planned way out. I think the idea really emanated from what happened the week before, because it focused everyone’s attention on the fact we went through another type of attack.”

Mr. de Blasio appeared to be referring to the delivery a week ago of pipe bombs to the Manhattan offices of CNN and the actor Robert De Niro, as well as to prominent Democrats and critics of President Trump around the country; and the shooting in the Tree of Life synagogue in Pittsburgh, in which 11 Jewish worshipers were killed.

Mr. de Blasio’s press secretary, Eric F. Phillips, said that preparation for the memorial began on Sunday, adding that the families were not invited until Tuesday, the day before the event. He would not say which mayoral office or aide handled the preparation.

“I didn’t have anything to do with the details to put together the event, but I still have to take responsibility as mayor,” Mr. de Blasio said on Thursday. “It wasn’t handled right and I apologize to the families.”

[Here are 10 of our best reads from our New York campaign coverage.]

It was the second time that Mr. de Blasio has tripped in a significant way over his attendance at a memorial ceremony, the type of occasion that should be rote for New York City mayors.