NEW YORK — When Yosef Rapaport went to synagogue for the Jewish holiday of Purim in March, he brought some hand sanitizer with him. He had been reading some reports about a virus that was quickly spreading, so when someone tried to shake his hand, he declined.

“Oh, really? You’re so scared,” the Hasidic Jewish community leader recalled the person saying.

In hindsight, Rapaport said, even going into that synagogue could have been dangerous; at 66, he is considered high risk. He was right to be cautious. A month later, Rapaport’s brother died of complications from covid-19. Then his brother-in-law died. Just this week, he said a special prayer for a 92-year-old Holocaust survivor who had been diagnosed with the virus.

Yet, despite the many deaths in the Hasidic Jewish community since the beginning of the pandemic, Rapaport said a lot of his neighbors in the Brooklyn neighborhood of Borough Park continue to cast doubt on the severity of the virus and defy restrictions.

“There’s a perfect storm of misinformation,” he said.

Now, members of the Hasidic Jewish community are deeply upset over new restrictions announced by New York Gov. Andrew M. Cuomo earlier this week to contain the spread of the coronavirus, and they feel targeted by how the rules specifically single out houses of worship. Several synagogues and rabbis have filed a lawsuit asking for a temporary restraining order to bar the state of New York from enforcing its restrictions, saying the limits disrupt the religious observance of tens of thousands of Orthodox Jews, “depriving them of their religious worship and holiday observance.”

Other faith groups and congregations have also challenged similar coronavirus restrictions across the country. On Thursday, the Catholic diocese of Brooklyn filed a separate lawsuit against Cuomo for closing churches in certain neighborhoods where coronavirus rates have spiked.

Sitting in his son’s dining room in the neighborhood of Borough Park on Wednesday, Rapaport said that many people in his community are angry with city officials who allowed massive Black Lives Matter protests but are now cracking down on their religious gatherings.

Rapaport pointed to a recent statement from Agudath Israel of America, an Orthodox Jewish umbrella organization, that called Cuomo’s “unanticipated and draconian limitations” on synagogue attendance concerning. They said that although Cuomo said he had “a good conversation” with Orthodox Jewish leaders, it was “largely a one-way monologue.”

“It’s astounding,” Rapaport said. “They’re calling the governor a liar. You really have to convince the leadership here if you want something done.”

Protests have broken out in every evening in this community. Earlier this week, a crowd of Hasidic Jewish protesters set fire to masks and attacked a photojournalist in Borough Park.

Other Hasidic Jews outside Borough Park said the protests earlier this week were “repugnant,” and not in line with how Orthodox Jews conduct themselves, according to Motti Seligson, spokesman for Chabad, an organization of Hasidic Jews based in the Crown Heights neighborhood of Brooklyn. At the same time, he said, many Hasidic Jewish communities, already feeling vulnerable and targeted from the pandemic itself, are then stigmatized by public officials.

Recently, Seligson said, he was stopped by someone on the street and thanked for wearing a mask and felt visibly identifiable as someone who could be a carrier of a disease.

“In many cases, there has been covid-19 shaming,” he said. “We should’ve been treated like any of the other minority communities.”

Public officials say they are trying to curb a worrisome increase in infections in parts of Brooklyn and Queens. The city’s overall positivity rate for coronavirus has been around 1 percent for more than two months but it has risen to above 3 percent in recent weeks, prompting the governor’s actions. If it continues to rise, it could cause the city to reverse course in its reopening efforts. Over the past week, the city has had an average of 1,325 cases per day, an increase of 68 percent from the average two weeks earlier, according to data collected by the New York Times.

“This is about mass gatherings,” Cuomo said in a recent news conference. “And one of the prime places of mass gatherings are houses of worship.”

Cuomo’s new restrictions focus on clusters of cases and divides neighborhoods into zones; houses of worship in red zones are reduced to 25 percent capacity and 10 people maximum. In neighborhoods that do not have an assigned zone, indoor religious services are limited to 50 percent of the maximum occupancy for the room. Outdoor services have no restrictions.

New York Mayor Bill de Blasio recently ordered the police to enforce public health guidelines, a crackdown that came at the end of Jewish High Holidays.

City officials have also been distributing masks and literature in recent weeks, according to New York spokesman Patrick Gallahue. Ads about safety precautions and health guidance have been running since February in community media, he said. The results have been mixed.

At a small outdoor service for the holiday of Sukkot in the driveway of Rapaport’s son’s home, there were disposable masks and hand sanitizer next to Jewish prayer books and palm fronds.

But masks are often considered optional, several people in the neighborhood said. One man, who spoke on the condition of anonymity because he said it could jeopardize his work, said that after a push from the schools to save them from being closed, some people started to wear masks as “a show” for people outside, but when they enter a synagogue they would take it off.

While watching his three children, whose schools are shut down, at a neighborhood playground, Boruch Lowen said he puts his mask on when he is in a synagogue, but has trouble breathing with his mask on and feels dehydrated and prefers not to wear it outside. His children had lanyards attached to masks, dangling from their necks.

Lowen said he doesn’t fear the virus, pointing to President Trump’s recent diagnosis and said there are more effective treatments than there were earlier this year when thousands of people died in New York. Trump is a favorite among many here, where Hasidic Jews applaud Trump’s actions on Israel, specifically moving the U.S. Embassy to Jerusalem.

Lowen pulled a photo from his phone that showed an airplane full of people with masks contrasted by a photo of empty church pews. In his neighborhood, empty yellow school buses sat parked by shuttered yeshivas nearby.

“They’re lying about the cases,” Lowen said of local and state officials. “It’s hard for the kids and it’s hard for the parents.”

The resentment toward the coronavirus restrictions is also fueled by past negative experiences with government leaders. In April, de Blasio received backlash when he tweeted a warning toward those gathering in large groups, specifically naming “the Jewish community,” which some feared could spark anti-Semitism. Demographers believe Orthodox Jews make up only about 10 percent of American Jews.

After a lawsuit was filed by two priests and three Orthodox Jews, a federal judge ruled in June that New York state was violating the First Amendment by restricting religious gatherings while simultaneously allowing both much larger protests sparked by the death of George Floyd.

A similar clash between some Orthodox Jewish communities and public officials erupted in 2019 when large cases of the measles broke out due in part to resistance to vaccinations. Borough Park-based journalist Meyer Labin wrote that the high spread of the coronavirus in his community is due to a number of factors, including how many in the community have limited access to the Internet. The average Hasid comes into contact with hundreds of people daily and shutdowns bring up dark memories for descendants of Holocaust survivors.

.

Avital Chizhik-Goldschmidt, who is married to an ultra-Orthodox rabbi and writes for the Forward, a Jewish outlet, said Leaders in the Hasidic community have been casting blame on government officials and as “a deliberate political move, a deflection of responsibility.”

Once gatherings in the city were permitted, hundreds of people gathered for weddings without distancing, she reported. Leaders, she said, have not done much to prevent more cases. But Chizhik-Goldschmidt says she has seen some hopeful signs that more people are taking the uptick in infections seriously and donning masks.

“Pretty much everyone knows someone who got sick in the last two weeks or so, I would wager — it brings it home that this hasn’t passed over us, by any stretch of the imagination, and it seems a lot of people are getting spooked into compliance,” she said.