Social media platforms including Facebook, YouTube and Twitter have been scrambling to scrub the disturbing footage of the New Zealand mosque massacre from their sites — even hours after the gunman apparently livestreamed one of the shootings.

The 17-minute video first went up on Facebook, giving viewers a first-person view as gunman Brenton Tarrant shot up worshipers inside Masjid Al Noor in Christchurch on Friday afternoon local time.

Facebook eventually took down the footage, but declined to say exactly when.

“New Zealand Police alerted us to a video on Facebook shortly after the livestream commenced and we quickly removed both the shooter’s Facebook and Instagram accounts and the video,” Mia Garlick, Facebook’s director of policy for Australia and New Zealand, said in a statement.

But clips of the sickening attack have since turned up elsewhere on Facebook, YouTube and Twitter — sparking scrutiny over how the companies handle violent content.

The video appears to have been shot using a GoPro helmet camera and uploaded to the Facebook account for “Brenton.Tarrant.9.”

Before going live, video was announced on message board 8chan — with users encouraging others to download copies — and then reposted on Twitter and YouTube, the Washington Post said.

The video was also discussed on Reddit. It’s made its rounds on Facebook-owned Whatsapp and Instagram.

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

The video giant, which is owned by Google, also said it removes “shocking, violent and graphic content” as soon as it’s flagged. The company declined to say when the video was removed.

Facebook added that it was actively “removing any praise or support for the crime and the shooter as soon as we’re aware.”

Meanwhile, police in New Zealand are urging people to not share the video.

The shootings left 49 people dead at Masjid Al Noor and Linwood Masjid Mosque a few miles away.