Peers have voted against a government proposal under which courts could stop people being annoying in public.

Ministers want to replace anti-social behaviour orders in England and Wales with injunctions to prevent nuisance and annoyance (Ipnas).

Courts could impose these on anyone engaging - or threatening to engage - in "conduct capable of causing nuisance or annoyance to any person".

But the government was defeated by 306 to 178 votes in the Lords.

The 128-vote defeat came despite ministers offering to hold talks about how the proposed measure could be improved.

Our aim is to ensure that decent law-abiding people can go about their daily lives, engage in normal behaviour... without having their own freedoms constrained by anti-social individuals Lord Taylor of Holbeach, Home Office minister

The BBC's deputy political editor James Landale said many peers believed the new injunction would undermine freedom of speech and association.

Crossbench peer Lord Dear, who led opposition to the plan, said anyone over the age of 10 could be served with an Ipna, which could last for an indefinite period of time and result in a prison term if breached.

"It risks it being used for those who seek to protest peacefully, noisy children in the street, street preachers, canvassers, carol singers, trick-or-treaters, church bell ringers, clay pigeon shooters, nudists," he said.

"This is a crowded island that we live in and we must exercise a degree surely of tolerance and forbearance."

Campaigners said the laws would not deter those most intent on causing trouble and likely to be committing other offences.

"But it will give massive power to the authorities to seek court orders to silence people guilty of nothing more than breaching political correctness or social etiquette," Reform Clause 1 campaign director Simon Calvert said.

'Elastic term'

Crossbencher Lord Blair of Boughton, a former commissioner of the Metropolitan Police, said: "This is a piece of absolutely awful legislation and we should seek to avoid it."

Former Labour Attorney General Lord Morris of Aberavon criticised the Home Office for bringing forward "ill thought out" proposals with "little regard for the consequences".

"The Home Office I fear, from time to time, does not fulfil a purpose as a guardian of our liberties and as a watchtower against infringement of those liberties," he said, arguing that the words harassment, alarm and distress had been well tested in the courts.

"Nuisance and annoyance is such an elastic term that, if applied widely, can be open-ended machinery which would catch all sorts of people who really should not be before the courts," he concluded.

The Home Office has said the new injunctions - part of the Anti-social Behaviour, Crime and Policing Bill - would never be imposed in an unreasonable way.

And Home Office minister Lord Taylor of Holbeach denied that the bill would create a "chilling effect" on free speech.

"Lords have suggested, for example, that an injunction could be sought against bell ringers or street preacher or carol singers or indeed others engaging in perfectly normal everyday activities.

"That is clearly not the government's purpose. It is my belief that these concerns are misplaced. The purpose of our reforms is not to prevent people exercising their rights to protests and free speech.

"Our aim is to ensure that decent law-abiding people can go about their daily lives, engage in normal behaviour and enjoy public and private behaviour without having their own freedoms constrained by anti-social individuals."

The government could seek to reinsert the proposal in the bill later in its passage through the Lords and, if that fails, when it returns to the House of Commons.

Both Houses of Parliament must agree on the final wording of the bill before it can be sent for Royal Assent, when the Queen approves bills and they become law.