(CNN) Internet providers and tech giants like Facebook and Google will be compelled to remove violent content in a sweeping new law passed in Australia in the wake of the Christchurch massacre that killed 50 people.

Under the new law , which passed both houses of Parliament Thursday, obligations will be placed on internet companies to stop the spread of violent material. Failure to do so could see executives face up to three years in jail, or fines of up to 10% of the platform's annual turnover.

Much of the March 15 massacre was live streamed on social media by the shooter. Platforms have struggled in the weeks since to remove copies of the video, which have been repeatedly uploaded.

"The tragedy in Christchurch just over two weeks ago brought this issue to a head," Australian Attorney General Christian Porter said in a statement.

"It was clear from our discussions last week with social media companies, particularly Facebook, that there was no recognition of the need for them to act urgently to protect their own users from the horror of the live streaming of the Christchurch massacre and other violent crimes, and so the (government) has taken action with this legislation."

Read More