Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Jihad Turk was at a gym in Los Angeles with his 16-year-old son Thursday night when his cellphone began buzzing with urgent messages from Muslim leaders around the country bearing news of a massacre at two New Zealand mosques.

Turk, 47, who was previously the imam at the Islamic Center of Southern California, said it quickly became “clear there were going to be a large number of casualties.” New Zealand authorities said 49 people were killed in the mass shootings during Friday prayers in Christchurch.

The Muslim leaders in the WhatsApp group chat with Turk shared mental health resources, messaging about how to process what was going on and “guidance for how to protect your mosque tomorrow,” said Turk, who is the president of Bayan Claremont, an Islamic graduate school outside Los Angeles.

“I was emotionally challenged because I’m modeling for my 16-year-old son how to remain calm,” said the father of four, his voice breaking.

“I didn’t want him to be afraid,” he said.

As Muslims across America gathered for Friday prayers, worshippers struggled to find words to express their shock and devastation at a terrorist attack thousands of miles away but also terrifyingly close to home. Some said they found comfort in mourning communally; others said they were determined to defy the fear that they, too, would be targeted.

“I don’t feel safe," said Meriem Hanade, 28, a student visiting from France who prayed at the Islamic Cultural Center of New York on Friday. "I was afraid to come."

Imams and other Muslim leaders sought to reassure shaken communities, while also grappling with how to secure their houses of worship. The threat of violence is not new to Muslims in a country where anti-immigrant sentiment is aired at the highest levels and mosques have been vandalized and targeted with attacks, but what happened in New Zealand made clear to many that more protection was needed. In a statement Friday morning, the Council on American-Islamic Relations urged mosques, Islamic schools and other institutions to increase security.

Mohamed Omar, executive director of the Dar Al-Farooq Islamic Center in Bloomington, Minnesota, said it was “a heartbreaking day.”

Mohamed Omar, executive director of the Dar Al-Farooq Islamic Center. Caroline Yang for NBC News

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

The Minnesota mosque was bombed by a white militia group in August 2017. No one was killed, but the imam’s office was destroyed.

“I’m very emotional right now. When we heard about this attack, it made us feel like we’re not safe in our own mosques,” he said.

In New Zealand, the main suspect in the massacre had appeared to post a lengthy manifesto full of anti-immigrant, anti-Muslim and white-supremacist references and was described by officials as a "right-wing extremist terrorist."

In the U.S., the number of anti-Muslim hate crimes fell slightly to 273 in 2017 from 307 in 2016, though that's still up from the annual average of 144 from 2011 to 2014, according to the FBI.

Omar said his mosque was “definitely” considering increasing security.

“We also need our neighbors and friends, people in our community, to come together to show our members who feel vulnerable, especially women and children, that they are safe to worship,” he said.

Hassan Jama, executive director of the Islamic Association of North America and imam-at-large at Dar Al-Farooq, said he believed “mosques nationwide should hire armed security guards and take any steps they can to protect their worshippers.”

“We need to be vigilant,” he said. “I would also encourage all Muslims nationwide to go to mosques this afternoon, pray and practice their religion as they want. Don’t be afraid.”

Hassan Jama, executive director of the Islamic Association of North America. Caroline Yang for NBC News

The Islamic Center of Southern California, where Turk was the imam, is also no stranger to anti-Muslim extremism. In 2016, a man who was found with weapons and hundreds of pounds of ammunition was charged with making terroristic threats against the center.

Turk said the center had private armed security before those threats and had increased safety measures since. He recommended that other houses of worship also have armed security and work closely with local law enforcement.

On Friday, police in cities across the U.S. — including Los Angeles, New York and Chicago — said they were adding resources around mosques.

While the stepped-up law enforcement presence was reassuring to some worshippers on Friday, others worried that it would make some Muslims apprehensive because of the history of police surveillance and immigration enforcement actions against their community.

“The presence of law enforcement outside houses of worship in some Muslim, Arab or South Asian American communities will not necessarily lead members of those communities to feel more safe,” said Suman Raghunathan, executive director of South Asian Americans Leading Together, a nonprofit that advocates for South Asians' civil rights in the U.S.

Raghunathan said that the police surveillance and racial profiling in Muslim communities after 9/11 has made it difficult for some to trust the intentions of law enforcement officers.

“Much of that scrutiny often has been historically targeted at mosques in particular," she said. "Many in our communities have not forgotten that dynamic."

Jama, the imam-at-large at Dar Al-Farooq, said that while there has been a history of harassment and racial profiling, “Muslim people are ready to collaborate with law enforcement and seek their advice. I would invite them to give training to imams and mosque leaders, too.”

As mosques assessed their security, Muslims poured in Friday for prayers. In Los Angeles, the Islamic Center planned to hold a vigil ahead of the traditional prayers.

“For the people who are coming, we hope to provide them a sense of peace and security at a time of instability and fear,” Turk said.

Since the shooting, Turk said he had been contacted by rabbis, Christian leaders and others expressing support.

"We have been overwhelmed," he said, "both with tragedy, but also with solidarity."