The attempted attack on a provocative cartoon contest in Texas appears to reflect a scenario that has long troubled national security officials: A do-it-yourself terror plot, inspired by the Islamic State extremist group and facilitated through the ease of social media.

Trying to gauge which individuals in the United States pose such threats — and how vigorously they should be monitored — is a daunting challenge for counterterrorism agencies. Some experts caution that a limited number of small-scale attacks are likely to continue.

Michael McCaul, chairman of the House Homeland Security Committee, said federal authorities are aware of "thousands" of potential extremists living in the U.S., only a small portion of whom are under active surveillance.

Concerns have been intensifying since the rise of Islamic State group and were heightened this week after two gunmen were shot dead while trying to attack the event in Garland, Texas, that featured cartoon images of the Prophet Muhammad. One of the men, 31-year-old Elton Simpson of Phoenix, was arrested in 2010 after being the focus of a four-year terror investigation; investigators are trying to determine the extent of any terror-related ties involving him or his accomplice, Nadir Soofi.

At the White House, Press Secretary Josh Earnest said Wednesday that intelligence officials would be investigating Islamic State's claim of responsibility for the incident.

"This is consistent with what has previously been described as a lone wolf attack," Earnest said. "Essentially you have two individuals that don't appear to be part of a broader conspiracy, and identifying those individuals and keeping tabs on them is difficult work."

Terrorism experts say the spread of social media — and savvy use of it by extremist groups — has facilitated a new wave of relatively small-scale plots that are potentially easy to carry out and harder for law enforcement to anticipate.

While plots orchestrated by al-Qaida have historically involved grand plans designed to yield mass carnage — airline bombings, for instance, or attacks on transportation systems — the Islamic State group has endorsed less ambitious efforts that its leaders say can have the same terrorizing effect on Western society.

"If you can get your hands on a weapon, how is the state security apparatus supposed to find you?" said Will McCants, a fellow for the Center for Middle East Policy at the Brookings Institution in Washington. "It's attractive because it gets just as much attention as a small- to mid-size bomb."

A public forum like Twitter, with its millions of followers, means those who might otherwise have had limited exposure to terrorist ideologies now have ample access to what FBI Director James Comey has described as the "siren song" of the Islamic State group. Social media provides a venue for agitators to exhort each other to action, recruit followers for violence and scout locations for potential attacks.

"The speed with which someone can find an active jihadist and connect with them over Twitter, let's say, and start direct messaging with them — that speed happens much faster now," McCants said.

This phenomenon poses a challenge for investigators as they sift through countless online communications.

"Where is the threshold of saying this is more than just an avid consumer of propaganda?" asked William Braniff, executive director of a terrorism research center at the University of Maryland and a former instructor at the U.S. Military Academy's Combating Terrorism Center.

"It's exceptionally difficult to estimate of the number of people who've considered becoming foreign fighters," he said. "Often you're not dealing with specific behaviors, but with expressions of belief, which are constitutionally protected."

U.S. officials say that more than 3,400 people from Western countries — including nearly 180 from the U.S. — have gone to Syria or Iraq, or attempted to do so, to fight on behalf of Islamic State or other extremists groups.

Although there is concern that fighters returning to the U.S. might pose a terrorism threat, some national security experts say a more immediate danger is posed by individuals in America who are inspired by these extremist groups yet have no direct ties to them.

Such individuals "can be motivated to action, with little to no warning," National Counterterrorism Center director Nicholas Rasmussen told the House Committee on Homeland Security in February. "Many of these so-called homegrown violent extremists are lone actors, who can potentially operate undetected and plan and execute a simple attack."

He predicted that the threat posed by these individuals will remain stable, "resulting in fewer than 10 uncoordinated and unsophisticated plots annually from a pool of up to a few hundred individuals."

The online propaganda can be alluring, even to U.S. residents leading comfortable lives, said Peter Bergen, director of International Security Program at the public policy institute New America.

In testimony Bergen planned to give Thursday before the Senate Homeland Security Committee, he says some of the Islamic State group recruits are motivated by the same level of idealism as young people who join the Marines or the Peace Corps. In their view, Bergen asserts, the extremist group "is doing something that is of cosmic importance."

Daniel Benjamin, former coordinator for counterterrorism at the State Department and now director of a global issues center at Dartmouth College, said the lone-wolf terrorist phenomenon is not new, but has taken on a new character due to the aggressive military and propaganda activities of the group also known as ISIS.

"What is new is the level of excitement among extremists," Benjamin said. "The feeling is that ISIS has done what al-Qaida couldn't — it has held territory, it has damaged armies much larger than it is."

Benjamin cautions that low-level, lone-wolf attacks may be difficult to stamp out, and said Americans should not let such attacks demoralize them.

"The government's top priority has to be preventing catastrophic attacks that claim lots of lives," he said. "It appears to have done that pretty effectively."

Long before this week, the lone wolf scenario manifested itself when Army Maj. Nidal Hasan, who had been inspired by a radical Yemen-based preacher, killed 13 people at Fort Hood in 2009. Earlier this year, an Ohio man, Christopher Lee Cornell, was arrested and accused of plotting to attack the U.S. Capitol in support of Islamic State militants.

Government officials have acknowledged that surveillance programs, however diligent, aren't the full answer to thwarting terrorism. Among the preventive strategies is federal program launched last fall called Countering Violent Extremism, which aims to encourage community engagement to thwart radicalization. It's been tested in Los Angeles, Boston and Minneapolis-St. Paul.

Peter Bergen, in his prepared testimony for the Senate committee, said relatives of potential Islamic state group recruits might be more willing to inform authorities if the family member faced options other than a long prison term. He suggested some sort of mix of a token prison term, followed by probation and counseling services.

John Cohen, a former Department of Homeland Security counterterrorism chief who now teaches at Rutgers University, has suggested a system of local interventions, modeled after programs already at work in battling gang and youth violence.

____

Tucker reported from Washington, D.C. Associated Press writers Ken Dilanian and Nancy Benac in Washington contributed to this report.