Peers have made an amendment to the Criminal Justice Bill that will protect the freedom of speech of comics, rap artists and those who criticise other people’s sexuality.

In the amendment, though it would be an offence to ‘incite hatred’ it would not be an offence to criticise people on the basis of sexuality.

The move will help be welcomed by rap artists who will have more freedom to write homophobic lyrics without having legal action taken against them.

Religious groups will also welcome the amendment, as many feared that the bill may see them prosecuted for talking openly about their objection to homosexuality.

Peers backed the amendment, tabled by the former Conservative home secretary Lord Waddington, by 81 votes to 57.

Former Culture Secretary Lord Smith, who in 2005 became the first MP to reveal he had HIV, said:

“Every single day in this civilised country of ours people are abused, attacked, have hatred expressed against them and on some occasions suffer extreme violence simply because of their sexuality.

“In my book incitement to hatred on grounds of sexual orientation is as unforgivable and unacceptable in a civilised society as incitement to hatred on grounds of race or colour.”

Colin Hart, Director of The Christian Institute told the Telegraph:

“We are delighted by this result. In recent years there have been a number of cases where overzealous police officers have unjustly interfered with the rights of Christians to express their religious beliefs on sexual ethics.

“I hope the Government will not try to overturn this sensible safeguard in the Commons.”

Ministers may choose to fight the amendment when the Bill returns to the House of Commons.