Social media’s widespread appeal has captured the attention of terrorists who are increasingly exploiting the networks to disseminate graphic videos, images and messages.

The dark side of social media — and human nature — was on display this week when the gruesome beheading of an American journalist and its fallout played out across the world's most popular networks.

As social media has become a staple of everyday Western life, its widespread appeal has captured the attention of terrorists who are increasingly exploiting the networks to disseminate graphic videos, images and messages from around the world.

"Social media is at the heart of their jihad," said Steven Stalinsky, executive director of the Middle East Media Research Institute.

The posts are intended to instill fear, attract new recruits and raise money on a global scale — and have forced tech giants into the difficult position of weighing the public's freedom to communicate against the need to censor troubling material. Three of the largest platforms — YouTube, Facebook and Twitter — all chose to police posts on the beheading, removing the most extreme examples.

"Terrorist organizations have moved their online presence to YouTube, Twitter, Facebook, Instagram and other social media outlets," Gabriel Weimann, a University of Haifa professor, said in a recent report on terrorism and social media. "They have turned to the new media not only because counterterrorism agencies have disrupted their traditional online presence but also because the new media offers huge audiences and ease of use."

On Tuesday, a video released by the militant group Islamic State displayed the beheading of James Foley, a freelance American journalist who disappeared in Syria nearly two years ago. Islamic State is the radical military group behind the latest violent insurgency in Iraq.

In the four-minute, 40-second video, posted on YouTube, Foley kneels in the desert in an orange uniform as a masked man cloaked in black stands beside him. Foley recites a statement calling the U.S. government his "real killers" and disavowing his American citizenship before he is beheaded.

News of the beheading spread like wildfire across social media, with users viewing the video and sharing the link on other sites. "James Foley" almost immediately became a trending topic on Twitter.

Twitter and Facebook users soon began posting impassioned pleas to not watch the content, calling it horrific, sickening and shameful. "#ISISMediaBlackout" became a popular hashtag. The White House reached out to social media networks asking them not to allow the posting of the video.

After it was flagged by users, YouTube quickly replaced the video with a message that said it violated the company's policy on violence. The Google-owned video network has been clear that while it defends "everyone's right to express unpopular points of view," it draws the line on several subjects, including pornography and bomb making.

"YouTube has clear policies that prohibit content like gratuitous violence, hate speech and incitement to commit violent acts," a company spokesperson said. "We also terminate any account registered by a member of a designated Foreign Terrorist Organization and used in an official capacity to further its interests."

Still, the footage was reposted around the Internet and is easy enough to find. Screen grabs showing the beheading made their way onto Twitter, along with tweets from users who praised the killing.

Many of those tweets began disappearing and Chief Executive Dick Costolo took to his own account early Wednesday to address the issue. "We have been and are actively suspending accounts as we discover them related to this graphic imagery. Thank you," Costolo tweeted.

Terrorists' use of the Internet to spread fear is not new. After 9/11, terrorist groups established thousands of websites to promote their messages and activities. Governments launched online attacks to shut down password-protected forums where terrorists once mingled online.

That pushed the groups to social media websites, which have presented an even more attractive medium.

With millions of connected users, these sites have the benefit of reach, interactivity and frequency of use. Users don't need to seek information, it's often blasted directly on their news feeds, making it easy to view and share.

Much of the content posted by terrorist networks is now well edited and comes in English, lending a level of sophisticated polish that has led to increased efficacy. Videos generally are far better produced than those released just a few years ago.

Islamic State, in particular, has been releasing videos and photos that feature punishment based on radical Islamic tenets, Stalinsky said.

He and a team of about 15 researchers have seen executions, beheadings, the cutting off of hands, people set on fire and women stoned to death. The images and videos get posted to social media websites and then are immediately saved on Internet Archive, a nonprofit digital library.

Even when accounts are shut down or content removed, they quickly resurface elsewhere in what can often feel like a futile game of whack-a-mole, Stalinsky said.

Islamic State has sharpened years of social media trials to become the most aggressive and successful terrorist organization on the Web, analysts said.

"We're seeing the full-fledged blossoming of all the lessons they've learned, and it's disturbing," said Evan Kohlmann, chief information officer at Flashpoint Global Partners, a research firm that has worked with Google Inc. on how to root out cyber-jihadism on YouTube.

Terrorists are also using social media to spread propaganda images of beautiful landscapes and happy camaraderie designed to lure Westerners to join Islamic State, he said.

"The real dramatic shift is not a technological shift, it's a shift in content and it's smart," Kohlmann said.

The terrorists are even adept at search-engine trickery. J.M. Berger, an analyst who tracks extremists on social media, said Islamic State supporters mentioned "Ferguson" in their posts so Americans searching for news about the chaos in Ferguson, Mo., would see the beheading video.

But Kohlmann warned that "there's a cost" to such methods and noted that in recent years, Al Qaeda began moving away from execution videos because they were alienating viewers, such as potential recruits.

"If you're fighting for human rights, how can you glorify spilling the blood of people like animals?" Kohlmann said. "It doesn't scream trustworthiness. It projects an image of chaos, and one that Al Qaeda didn't want to cultivate."

Although the negative attention surrounding such videos has forced social media companies to step up their efforts at combating misuse of their sites, Stalinsky said many just aren't acting swiftly or effectively enough.

"Why aren't they taking this more seriously? It's a national security issue," he said.

Facebook faced a rash of beheading videos late last year and deals with each on a case-by-case basis, spokeswoman Debbie Frost said.

"Facebook has long been a place where people turn to share their experiences, particularly when they're connected to controversial events on the ground, such as human rights abuses, acts of terrorism and other violent events," Frost said. "Our goal has always been to strike an appropriate balance."

Facebook has teams around the world who are reviewing activity related to Foley's beheading, and the company is removing posts in some cases. But in other situations -- such as when a user posts a condemnation of the act alongside an edited snippet of Foley's statement that omits the killing itself -- Facebook has allowed the posts to remain.

Marvin Ammori, a 1st Amendment scholar and a fellow at the New America Foundation, said social media networks have to grapple with being the modern town square. Because it's possible that the companies eventually could come under legal scrutiny for materially supporting terrorist organizations, he said, it's imperative that they find a way to restrict expression.

"If the speech there is not what we consider core to democracy, then they have to make a judgment based on the core values of their platform: free expression with some boundaries," he said. "The problem is the boundary is hard to define."