“But singling out one community is ridiculous,” he added in another post. “Every neighborhood has people who are being non-compliant. To speak to an entire ethnic group as though we are all flagrantly violating precautions is offensive, it’s stereotyping, and it’s inviting antisemitism. I’m truly stunned.”

Jonathan Greenblatt, the head of the Anti-Defamation League, said the mayor’s remarks were unfair to the more than one million Jewish people who live in New York City.

“The few who don’t social distance should be called out — but generalizing against the whole population is outrageous especially when so many are scapegoating Jews,” he wrote on Twitter. “This erodes the very unity our city needs now more than ever.”

Other people noted the size of the crowds that had gathered earlier in the day across the region to watch a military flyover by pilots from the Navy’s Blue Angels and the Air Force’s Thunderbirds honoring essential workers.

The Orthodox Jewish Public Affairs Council said in a post on Twitter that “people failed to social distance at a funeral the same day that thousands of New Yorkers failed to distance for 45 minutes to watch a flyover.”

On Wednesday, Mr. de Blasio defended his remarks at a news conference and said he “spoke last night out of passion.”

“I spoke out of real distress that people’s lives were in danger before my eyes and I was not going to tolerate it,” he told reporters. “I regret if the way I said it in any way gave people a feeling of being treated the wrong way, that was not my intention. It was said with love but it was tough love, it was anger and frustration.”