Australia will fine social media companies up to 10 percent of their annual global turnover and imprison executives for up to three years if violent content is not removed "expeditiously" under a new law passed by the country's parliament on Thursday.
The new law is in response to a lone gunman attack on two mosques in Christchurch on 15 March, killing 50 people as they attended Friday prayers.
The gunman broadcasted his attack live on Facebook and it was widely shared for over an hour before being removed, a timeframe Australian Prime Minister Scott Morrison described as unacceptable.
Australian Brenton Tarrant, 28, a suspected white supremacist, has been charged with one murder following the attack and was remanded without a plea. He is due back in court on 5 April, when police said he was likely to face more charges.
It is now an offence in Australia for companies, such as Facebook and Google, which owns YouTube, not to remove any videos or photographs that show murder, torture or rape without delay.
Companies must also inform Australian police within a "reasonable" timeframe.
"It is important that we make a very clear statement to social media companies that we expect their behaviour to change," Mitch Fifield, Australia's minister for communications and the arts, told reporters in Canberra.
Juries will decide whether companies have complied with the timetable.
A spokeswoman for Google declined to comment on the legislation specifically, but said the company has already taken action to limit violent content on its platforms.
A spokeswoman for Facebook was not immediately able for comment.
Facebook said last week it was exploring restrictions on who can access their live video-streaming service, depending on factors such as previous violations of the site's community standards.
Australia's opposition Labor party backed the legislation, but said it will consult with the technology industry over possible amendments if it wins power at an election due in May.
Australia's parliament will rise until after the election. The newly elected lawmakers will not sit until at least July.
Critics of the legislation said the government moved too quickly, without proper consultation and consideration.
"Laws formulated as a knee-jerk reaction to a tragic event do not necessarily equate to good legislation and can have myriad unintended consequences," said Arthur Moses, head of the Australian Law Council.
(Reporting by Colin Packham; Editing by Michael Perry)