Early Sunday morning, 49 people were killed and more than 50 were injured as Omar Mateen opened fire at Pulse, a popular gay nightclub in Orlando. It was the deadliest mass shooting in U.S. history.

RAND experts have previously noted that America's gun violence problem is “larger and much more complex than mass shootings” and recommended more research to help inform rational gun policy.

The gunman reportedly pledged allegiance to ISIS moments before the rampage. But there have been no signs that he was in contact with the group or that it somehow orchestrated the attack from overseas.

In this roundup of tweets, comments, and commentary, RAND experts provide perspective on last weekend's tragedy, what it likely means within the context of the campaign against ISIS, and more.

The shooting aligns with recent ISIS losses in Syria in Iraq. Homegrown attacks are “almost a byproduct” of military success against the group, said RAND's Colin Clarke:

#Orlando attack could provide propaganda boost to #ISIS which has suffered losses of territory, finances & recruits over past several months — Colin P. Clarke (@ColinPClarke) June 12, 2016

He also noted that this is exactly what ISIS was encouraging with its recent message from spokesman Abu Mohammad al-Adnani:

PT: This is exactly the kind of morale boost the group hoped for when Adnani released his #Ramadan message urging #ISIS followers to attack — Colin P. Clarke (@ColinPClarke) June 12, 2016

The attack also highlights the nature of the threat facing America, which RAND's Brian Michael Jenkins described late last year as “less one of infiltration and more one of inspiration.” Homegrown attackers like Mateen are often called “lone wolves,” but Jenkins has argued that “stray dogs” is more accurate.

Speaking after the massacre in Orlando, FBI Director James Comey described identifying homegrown terrorists as “looking for needles in a nationwide haystack and trying to figure out which pieces of hay will become needles.”

Given the enormity of this challenge, the FBI, which handled an inquiry into Mateen three years ago, doesn't get enough credit for keeping Americans as safe as it has, Clarke told KPCC's AirTalk after the Orlando shooting:

“There's a lot of targets to surveil, and these agencies don't have unlimited resources, so they need to figure out who's the most dangerous, and keep eyes on them. “And it's a waiting game. If this is someone who's been under surveillance and is able to stay under law enforcement's radar for years, how long do you keep surveilling them? “It's far more art than science. It's very, very difficult to figure out intent. Who's going to strike and who's not? Who's just mouthing off, who's a hothead, versus someone that's a little more serious.”

As Jenkins observed after the March attacks in Brussels, America's “lone wolf” problem is different than the main threat facing Europe: foreign fighters. ISIS recruits returning from Iraq and Syria have been instrumental in executing the bombing in Brussels and the November assault in Paris. The United States must pay attention to both threats, said RAND's Patrick Johnston:

Homegrown terror is top threat to the US, but an attack by #ISIS returnees could be as devastating as #Orlando https://t.co/kNzYXd6XFR — Patrick Johnston (@J0HNST0N) June 14, 2016

In a recent commentary, Johnston, along with RAND colleagues Benjamin Bahney and Howard Shatz, outlined recommendations for plugging ISIS's foreign fighter pipeline.

RAND's Jonah Blank and Cortney Weinbaum noted that religion often has little to do with the motivations of attackers like Mateen. Rather, attackers may be prone to use ideology as an excuse to commit violence:

.@lrozen @SZarifi One thing seems clear: Whatever tie he had to Islamist ideology was VERY thin, very confused, & nothing FBI could identify — Jonah Blank (@JonahBlank) June 14, 2016

More often, those who murder on behalf of #ISIS are not religious, but rage-filled criminals who think they found an excuse to inflict pain. — Cortney Weinbaum (@cortney_dc) June 13, 2016

RAND's Radha Iyengar cautioned against rhetoric that paints all Muslims as terrorists or terrorist sympathizers:

Research suggests that anti-#Muslim rhetoric makes it harder to stop attacks like the #Orlando shooting. Important to keep that in mind. — Radha Iyengar (@RadhaKIyengar) June 14, 2016

In an April commentary, Iyengar explained why such rhetoric is dangerous and self-defeating at length:

“It is likely that anti-Muslim rhetoric has already lessened the United States' ability to effectively collect intelligence, reduced the willingness of individuals to come forward with information, supported the Islamic State narrative, and increased the ease with which it can recruit new combatants.… Americans should reject such destructive language in the interest of national security.”

Jenkins, who recently explained why anti-Muslim demonstrations may pose a danger to America, concurred with Iyengar. In an interview with Wired magazine, Jenkins framed the aftermath of an attack like the Orlando shooting as a test of inclusiveness and other Western values:

“Ultimately, the strength of [Western] society is going to emerge in how we deal with this. Our success is not going to come from how many concrete barriers we can plant in front of buildings; it's going to come from how we're able to let our fundamental values prevail.”

Finally, Clarke warned about the divisive potential of terrorist acts:

Attacks like #Orlando are intended not just to terrorize populations but also to divide a country along political, social, religious lines. — Colin P. Clarke (@ColinPClarke) June 12, 2016

— Pete Wilmoth