The horrific mass shooting at two New Zealand mosques that left 49 people dead was live-streamed on Facebook and shared across social media, sparking a scramble by tech giants to remove the sick footage.

The gunman reportedly broadcast 17 minutes of the attack.

“Police alerted us to a video on Facebook shortly after the live stream commenced and we quickly removed both the shooter’s Facebook and Instagram accounts and the video. We're also removing any praise or support for the crime and the shooter or shooters as soon as we’re aware,” Facebook said in a statement.

49 KILLED AND DOZENS, INCLUDING YOUNG CHILDREN, INJURED IN NEW ZEALAND MASS SHOOTINGS TARGETING MOSQUES

"Our hearts go out to the victims, their families and the community affected by the horrendous shootings in New Zealand," the company added.

The company also deleted the shooter's accounts on Facebook and Instagram, which Facebook owns. Content praising or supporting the shooter is being deleted as soon as Facebook becomes aware of it.

Facebook uses a combination of technology, reports from the platform's users and specialist reviewers with the company to remove content that violates the social network's policies.

“Since the attack happened, teams from across Facebook have been working around the clock to respond to reports and block content, proactively identify content which violates our standards and to support first responders and law enforcement," said Mia Garlick, a spokeswoman for Facebook New Zealand, in a statement released Friday afternoon. "We are adding each video we to find to an internal data base which enables us to detect and automatically remove copies of the videos when uploaded again. We urge people to report all instances to us so our systems can block the video from being shared again.”

JACKSONVILLE MASS SHOOTING: CHILLING TWITCH LIVESTREAM RECORDS HORRIFIC ATTACK

The Associated Press reports that the footage was widely available on social media hours after the horrific attack.

The New York Times reports that before the shooting, a person that appears to be the gunman posted links to a white nationalist manifesto on Twitter and the controversial online forum 8chan.

Twitter has suspended the account in question, according to a source familiar with the matter. The company is also working to remove footage of the shooting from its service, noting that both are in violation of the company's policies.

YouTube, which is owned by Google, is also working to remove footage from its platform.

“Our hearts are broken over today’s terrible tragedy in New Zealand. Please know we are working vigilantly to remove any violent footage,” said YouTube, in a tweeted statement.

SOCIAL MEDIA GIANTS CLAMP DOWN ON SICKENING VIRGINIA SHOOTING FOOTAGE

"Shocking, violent and graphic content has no place on our platforms, and we are employing our technology and human resources to quickly review and remove any and all such violative content on YouTube," said the video sharing site, in a statement obtained by Fox News.

According to a source familiar with the situation, YouTube has removed thousands of videos related to the mass shooting.

The tech giant uses smart detection technology to scan its platform for violent extremist videos, most of which have fewer than 10 views when they are removed. Users are also encouraged to flag any content they think violates YouTube's guidelines.

The footage highlights the challenges facing social media firms in swiftly clamping down on vile that can be quickly shared across their platforms.

This is not the first time that a shooting has been live streamed. Last year, chilling live stream footage that showed the deadly shooting at a Madden 19 NFL tournament in Jacksonville surfaced on social media.

CLICK HERE TO GET THE FOX NEWS APP

In 2015, Facebook and Twitter, along with video sharing site YouTube, rushed to remove shocking video footage of the shooting of two television news journalists.

Fox News' Gillian Turner contributed to this article.

The Associated Press contributed to this article. Follow James Rogers on Twitter @jamesjrogers