“It’s not something we ever wanted to do,” the mayor said. “It’s something we have to do.”

Indeed, the actions of the governor and the mayor will profoundly alter life in New York. Restaurants and bars were commanded to slash their occupancy by half. Famed arenas like Madison Square Garden will go dark. Rock concerts and classical concertos will be canceled.

Nowhere was the impact expected to be more jarring than Broadway, a billion-dollar industry at the heart of New York’s tourist trade, which said it would be closed at least until April 12, though Mr. Cuomo offered no assurances that he would lift his edict by then.

“Let the science and let the data make the decisions,” said Mr. Cuomo, a third-term Democrat.

Mr. de Blasio, a Democrat, echoed that, saying that the restrictions on crowds and businesses could last six months.

“It is going to be a long painful episode,” he said.

Under the new “density reduction guidelines,” events with more than 500 people would be commanded to cancel or postpone. Spaces with occupancies of less than 500 would be required to cut those attendance levels by 50 percent. Schools, mass transit, hospitals, shops, and public buildings are exempt, though Mr. Cuomo said the State Capitol could be closed to visitors.

The coronavirus is particularly deadly for older people, and Mr. Cuomo also said “only medically necessary visits” would be allowed at nursing homes, a policy that would isolate residents from loved ones, something he admitted sounded draconian. But, he said, “If you care about someone in a nursing home, the last thing you want is to endanger that person.”

Both the governor and the mayor seemed resistant to closing schools, with Mr. Cuomo citing the resilience of most children to the virus. Mr. de Blasio said closing schools creates other problems, as schools provide many children with free or reduced cost meals. The mayor also announced a moratorium on evictions in public housing complexes.

Across the Hudson, New Jersey officials were also urging and encouraging the reduction of crowds, with Gov. Philip D. Murphy recommending that all public gatherings of more than 250 people be canceled across the state.