The use of insulting language will no longer be illegal in cases in which a specific victim cannot be identified, the home secretary, Theresa May, has said.

In a government climb down, the Public Order Act that covers speech and writing on signs and states: "A person is guilty of an offence if he uses threatening, abusive or insulting words or behaviour", will be changed to remove the word insulting. The move follows a high-profile campaign which united Christian and secular groups and was spearheaded by the comedian Rowan Atkinson, the human rights campaigner Peter Tatchell and the former shadow home secretary David Davis.

The push to change section five of the act followed a series of headline-grabbing arrests and prosecutions ranging from an Oxford student asking a police officer "Do you realise your horse is gay?" which Thames Valley police described as homophobic and "offensive to people passing by", to a 16 year old holding up a placard that said "Scientology is a dangerous cult".

In December, the government suffered a heavy defeat in the House of Lords which voted 150 votes to 54 in favour of an amendment to remove the word "insulting". Campaigners had complained the clause had been used by police as a "catch-all" offence to arrest people on trivial matters. It will continue to be illegal to use insulting language when an victim is clearly identifiable.

May told MPs the government was "not minded to challenge the amendment" made by the Lords even though ministers "believe that the police should be able to take action when they are sworn at, when protesters burn poppies on Armistice day and in similar scenarios".

She added: "I respect the review taken by their lordships, they had concerns which I know are shared by some in this House that Section 5 encroaches upon freedom of expression. On the other hand the view expressed by many in the police is that Section 5 including the word 'insulting' is a valuable tool in helping them keep the peace and maintain public order.

"Looking at past cases the director of public prosecutions could not identify any where the behaviour leading to a conviction could not be described as abusive as well as insulting. He has stated that the word insulting could safely be removed without the risk of undermining the ability of the CPS [Crown Prosecution Service] to bring prosecutions."

The government announcement has delighted Simon Calvert, director of the "feel free to insult me" campaign which argued the law should not be used to protect people from having their feelings hurt. "It is good news for free speech whoever you are," he said.

Keith Porteous Wood, executive director of the National Secular Society, said: "We congratulate the home secretary for removing a much-abused catch all provision where the police could charge anyone for using trivial words that irritated them.

"The police did not even need to identify the victim that allegedly had been insulted. The change is likely to prevent street evangelists preaching against homosexuality being charged."