MPs have voted to abandon the controversial badger cull in England entirely, inflicting an embarrassing defeat on ministers who had already been forced to postpone the start of the killing until next summer.

The motion in parliament to stop the cull was passed by 147 votes to just 28.

The debate in the Commons on Thursday gave MPs the first opportunity to vote on the cull, which was intended to curb bovine tuberculosis in cattle.

However, the government is not legally bound by the vote and could still press on regardless.

The shadow environment secretary, Mary Creagh, said after the debate: "The government should now come clean with the public and farmers and declare that the cull will not now go ahead. It is not fair for farmers to be strung along, and the public have shown that they will not accept a badger cull."

David Heath, the Liberal MP for Somerton and Frome, who is also the farming minister, made a forceful defence of the cull during the debate.

He said: "We cannot afford to shy away from tackling the rampant spread of TB throughout our cattle herds. None of [the opponents] – not the critics, not scientists, not politicians – have come up with a single workable alternative to the cull which would give us the positive impact we need right now."

The debate had been granted after more than 150,000 people signed an official government e-petition – an innovation that had been launched by Heath.

The environment secretary, Owen Paterson, was present for 20 minutes of the five-hour debate. Several Labour MPs reported that he said "I can't stand any more of this" as he walked out of the discussion.

Paterson said later: "I didn't storm in or out anywhere. As I left I might have joked about the ill-informed comments of the other side."

During the debate, Sir Jim Paice, who lost the farming minister's post in September's reshuffle, said that he and other ministers were under "special security measures due to threats from animal-rights extremists".

He also commented on the shooting of free-running badgers. The killing method marked a key difference between the government's proposals and the evidence arising from a landmark £50m, 10-year culling trial, in which 11,000 badgers were captured in cages then shot with pistols.

Paice said: "Nobody knows if controlled shooting will cull 70% of badgers [the minimum required] or be humane. There is no science, I readily admit that, because it has never been done."

He said that the now-postponed pilot culls in Somerset and Gloucestershire had to go ahead to "test free shooting".

But other MPs quoted eminent scientists who argue that killing badgers killing could well increase TB infections in cattle as infected animals flee the killing zone.

The lost vote means a problem for ministers if they decide to push on with the cull, as they risk being accused of ignoring the will of parliament.

On Wednesday, the attorney general, Dominic Grieve, said "parliament is sovereign" in the matter of whether the European court of human rights could force the UK to give prisoners the vote. Ministers would need to argue that parliament was not sovereign in the case of the badger cull, or possibly call another vote and whip MPs hard to ensure a victory.

Before the vote, Heath was asked by Tory MP Mark Pritchard: "Will ministers accept the will of this house?" Heath said they would "listen" to the views of the house.

Opponents of the cull welcomed the government defeat. Mark Jones at Humane Society International said: "The government has refused to listen to the majority of scientists, disease experts and the British people opposed to the cull. Surely now it must listen to the will of the parliament and abandon its policy for good … and stop wasting time and money on a politically motivated badger hunt."

Gavin Grant, chief executive of the RSPCA, said: "We stand ready to play a full part in working with farmers, land owners, the government and conservationists to move forward rapidly and constructively to tackle this dire disease in cattle and wildlife [using vaccination]."

• This article was amended on 29 October 2012. The original said Gavin Grant was chief executive of the RSPB, rather than the RSPCA. This has been corrected.