The celebration of Ramadan usually is the holiest and happiest month of the year for Muslims.

But for many on Long Island, a pall was cast over the observance, which ends Tuesday, by the deadly attack at a gay nightclub in Orlando, Florida, by a gunman who professed to be of the Islamic faith.

The Islamic Center of Long Island typically attracts at least 500 people to evening prayers during Ramadan, with the crowd spilling out of the Westbury mosque into a courtyard, said Isma Chaudhry, the mosque’s president.

The number plummeted to 150 after the June 12 massacre that claimed 49 lives and injured 53 others, she said.

People were greatly saddened, Chaudhry said, and also were “very afraid” that the mosque could become the target of a violent backlash.

The three-day festival called Eid al-Fitr, which follows the month of fasting from sunrise to sunset, promises to be more solemn and low-key than it ordinarily would be for many of Long Island’s estimated 80,000 Muslims, community leaders said. The region is home to about two dozen mosques.

On Wednesday, the first day of Eid, Chaudhry and other mosque leaders will hold a news conference to once again denounce the killings in Orlando and stress that the shooter, Omar Mateen, had nothing to do with Islam, which preaches peace.

advertisement | advertise on newsday

“We don’t consider him part of us,” said Hafiz Rehman, a leader of the Masjid Darul Quran mosque in Bay Shore.

Mateen and other terrorists who invoke Islam “hijacked the religion,” Rehman said. “We were very saddened that someone using a Muslim name would do this, especially in Ramadan.”

At the Islamic Association of Long Island, a mosque in Selden, leaders were concerned enough about a possible backlash after the shooting that they canceled a coffee and doughnut sales fundraiser for Syrian refugees that teenage members were planning to hold in the mosque parking lot.

Instead, they ordered the young people inside the mosque to pray, said Nayyar Imam, a leader of the mosque and the first Muslim chaplain to the Suffolk County Police Department.

Imam said that besides fear, there was anger in the Muslim community — anger that they and their religion were being blamed for Mateen’s actions.

“This idiot did something and why should we be considered part of this guy,” Imam said.

The Muslim leaders said the police departments in Suffolk and Nassau counties were exemplary in responding to their concerns quickly after the Orlando shooting and providing beefed-up security.

The Bay Shore mosque had extensive and immediate contact and assistance from Suffolk police after the Orlando attack, Rehman said.

Ramadan, which started June 5 this year, is one of the five pillars of Islam. It commemorates the time when the Prophet Muhammad received the Quran, the holiest book in Islam, from the angel Gabriel in the year 610.

In addition to fasting, Muslims engage in charity, self-reflection and making amends with those whom they have offended.

advertisement | advertise on newsday

Preparations for Eid will begin with some Muslims on Tuesday night, as some girls and women paint their fingernails with special designs for the holiday.

On Wednesday morning, mosques will start the day with several prayer services, followed by special meals with family and friends and visits to one another’s houses.