The laws, billed as a probable world first, follow last month's New Zealand mosque shootings which killed 50 people and were live-streamed by the gunman.
The Australian government said websites "should not be weaponised".
Critics say the laws have been rushed through parliament without scrutiny.
The bill says tech firms could face penalties if they fail to remove "abhorrent violent material" quickly enough. Such content is defined to be terror attacks, murders, rapes, tortures and kidnappings.
The penalties include fines of up to A$10.5m (£5.6m; $7.5m), or 10% of annual turnover, according to the legislation. Company executives or those who "provide a content service" could face up to three years in jail.
The laws put the onus on firms to take down the content "expeditiously" - a term that is not further defined but would be ultimately determined by a jury, the government said.
Social media sites struggled to contain the video of the Christchurch attacks, which was copied onto the alt-right file-sharing site 8chan and then spawned 1.5 million copies.
Last week, Facebook said it would explore restrictions on live-streaming in the wake of that event.
Prime Minister Scott Morrison proposed the laws for the first time last week.
The Labor opposition helped to pass the legislation on Thursday, despite describing it as "flawed". It pledged to review the laws after Australia's election, which is expected to take place next month.
Attorney-General Christian Porter said the crackdown was "most likely a world first".
"There are platforms such as YouTube, Twitter and Facebook who do not seem to take their responsibility to not show the most abhorrently violent material seriously," he said on Thursday.
Mr Morrison met last week with social media executives, who have since criticised the bill - as have legal experts.
The Digital Industry Group, which represents several tech companies in Australia, said firms were already committed to removing violent content quickly.
"With the vast volumes of content uploaded to the internet every second, this is highly complex problem," a spokeswoman said.
Legal experts warned that the law in its current form could lead to media censorship or prevent whistleblowers from sharing information.
"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 the Law Council of Australia.