A new law criminalising stirring up homophobic hatred comes into effect today.

The law, which covers England and Wales, will punish offenders with up to seven years in jail or a fine. It brings protections for gay people in line with laws against racial and religious hatred.

Stonewall claimed that a new offence was necessary after it discovered a range of “extreme” websites with anti-gay material. Homophobic song lyrics could also be covered by the law.

Stonewall chief executive Ben Summerskill said: “The newly-extended criminal offence of incitement to hatred will go some way towards addressing the hatred and violence directed towards lesbians, gay men and bisexuals in Britain at a time when homophobic attacks are on the increase.

“It sends a strong signal that such behaviour is unacceptable in a civilised society. Just like race, a person’s sexual orientation is an intrinsic characteristic for which no citizen should ever feel under threat of verbal or physical violence.”

It is unlikely the new law will be used frequently. Similar laws against inciting racial hatred have only been used around 20 times in the 30 years since they came into force.

The legislation will not make it a crime to criticise or tell jokes about homosexuality.

Both religious leaders and comedians had expressed concern that they would be criminalised under it.

While Stonewall and government supporters claimed the initial legislation would not impede freedom of speech, the House of Lords passed an amendment to protect those who criticise homosexuality or urge gays to turn straight from prosecution.

The amendment, tabled by Tory peer and former home secretary under Margaret Thatcher Lord Waddington, allows the “discussion or criticism” of sexual practices.

The issue is likely to come up for debate again if Labour wins the general election.