Criminalising the sharing of non-consensual sexual images, including those which are digitally altered, is being hailed as a step forward in preventing violence against women.
People who share such images will face up to six years in prison, while creators could be subject to seven years.
The prison penalties - applicable in circumstances considered "aggravated" - become applicable for repeat offenders who have previously been fined or subject to a take-down order by the eSafety commissioner.
The new laws - which passed parliament on Wednesday - capture the sharing and creation of deepfake images, which are digitally altered images of a person or their body, including those superimposed onto pornography.
Between 90 and 95 per cent of deepfakes are non-consensual pornography and 99 per cent of deepfake victims are women, a parliamentary inquiry was told previously.
Independent Senator David Pocock said the legislation sent a strong signal society wouldn't stand for the use of artificial intelligence to enable harmful behaviour in any form.
"We need to be doing everything possible to bring down the level of violence, predominantly against women and children, in this country and protect our young people in particular from a growing number of digital harms," he told AAP.
Attorney-General Mark Dreyfus said the overwhelming targeting of women and girls perpetuated "harmful gender stereotypes and contributed to gender-based violence".
"This insidious behaviour can be a method of degrading, humiliating and dehumanising victims," he said.
There has been an exponential increase in these images, spurred by technology developments and artificial intelligence, making creation easier.
The Liberals support the bill but shadow attorney-general Michaelia Cash warned of potential unintended consequences with a definition of consent removed.
"Consent is likely now to become a contested issue at trial," she said.
"The natural progression of that becomes more cross-examination of the victims and in particular about what a victim did or didn't consent to, which obviously means now more pressure on the victims."
Representing the attorney-general in the Senate, senior Labor minister Murray Watt said it was expected courts would rely on the ordinary meaning of consent outlined in the bill's explanation, which meant a free and voluntary decision.
The Greens pushed to explicitly criminalise the creation of non-consensual deepfakes and threats to create them as standalone offences.
The government argued such offences remained the remit of the states and territories and were not within the Commonwealth jurisdiction.
The nation's attorneys-general are working on harmonising laws.
Lifeline 13 11 14
Kids Helpline 1800 55 1800 (for people aged 5 to 25)