The Scottish government has published a bill that would decriminalise blasphemy, more than 175 years after the last case was prosecuted.

The devolved administration in Edinburgh said the continued criminalisation of blasphemy, which falls under hate crime laws, “no longer reflects the kind of society in which we live”.

Justice minister Humza Yousaf said the law would be modernised and also cover discrimination against age, disability, race, religion and sexual orientation.

“Stirring up of hatred can contribute to a social atmosphere in which discrimination is accepted as normal,” he said.

“By creating robust laws for the justice system, parliament will send a strong message to victims, perpetrators, communities and to wider society that offences motivated by prejudice will be treated seriously and will not be tolerated.”

The bill was welcomed by Humanists UK, which has been campaigning against blasphemy laws since 2015.

“Humanists have been calling on governments everywhere to repeal laws like these in solidarity with the victims of oppressive blasphemy laws around the world,” its chief executive, Andrew Copson, said.

If the law is passed, Scotland will become the latest in a series of counties, including Denmark, Canada, Greece and Ireland, to decriminalise blasphemy.

The last recorded charge of blasphemy in Scotland was brought against bookseller Thomas Paterson for “exhibiting placards of a profane nature” in his shop window in 1842.

Blasphemy laws were repealed in England and Wales in 2008.