John Bercow fights back tears after motion to introduce secret ballot to elect Speaker in next parliament is defeated by 228 votes to 202

William Hague, the outgoing leader of the house, suffered a humiliating rebuff on his final day in the Commons when a Tory backbench rebellion saw off an attempt, engineered by Hague and the chief whip, Michael Gove, to start the ousting of the Speaker, John Bercow.

A motion to ensure there was a secret ballot to elect the Speaker in the next parliament was defeated by 228 to 202.

The result, prompting Bercow to fight back tears, was greeted by enthusiastic and rare applause in the chamber by Labour MPs who had managed to stave off the Tory ambush to bring in a secret ballot, a procedure that would increase the chances that Bercow would be removed.

Hague was accused of “a grubby, squalid and nauseous” plot and was repeatedly told by Labour and some Tory MPs that he had been unwise to engineer a vote on such an important constitutional issue on the last day of parliament and give virtually no notice.

The debate was important because the Speaker will have a significant role in how parliament is involved in any negotiations on a future coalition, but it also underscored the degree to which Bercow, a reforming Speaker, has alienated the government and many backbench Tory MPs. David Cameron was one of many government ministers who rushed back to the Commons to demand a secret ballot.

The plan was only tabled by government late on Wednesday afternoon and was kept from Charles Walker, the chairman of the procedure committee, the relevant Commons body that had first called for the issue to be debated more than two years ago.

Facebook Twitter Pinterest Charles Walker brought Labour MPs to their feet in applause with his speech in the Commons. Photograph: Martin Godwin

In a highly charged debate, Walker brought Labour MPs to their feet in applause when he revealed that Gove had given him no notice of his plan to rush forward a debate on the future of the Speaker.

His voice cracking with emotion, Walker said: “I have been played as a fool and when I go home tonight I will look in the mirror and see an honourable fool looking back at me, and I would much rather be an honourable fool in this, and any other matter, than a clever man.”

He went on: “How you treat people in this place is important. This week I went to the leader of the house’s leaving drinks. I went into his private office and was passed by the deputy leader of house yesterday, all of whom would have been aware of what they were proposing to do.

I have been played as a fool and when I go home I will look in the mirror and see an honourable fool looking back at me Charles Walker MP

“I also had a number of friendly chats with our chief whip yesterday and yet I found out last night that this leader of the house is bringing forward my report.”

He admitted he had been unable to control his temper at the whip’s discourtesy.

Tory MPs said although the vote was nominally a free vote, the Conservatives imposed a three-line whip to be in parliament, and it is understood the Tory payroll vote were encouraged to attend – including David Cameron, who rushed back from Coventry to attend the vote. At a parliamentary party meeting, Tory MPs were reminded it was William Hague’s birthday and that he deserved the present of not being defeated.

The only Liberal Democrat who voted with the secret ballot motion was Don Foster, the outgoing party chief whip. The result still leaves Bercow vulnerable to an open challenge after the election and he will be under pressure to reach out to the Tory MPs that he has alienated.

Some Tory MPs demanded that the Speaker withdraw from a highly polarised debate, and others challenged the alleged bias in the MPs he had called to speak.

Labour MPs, and some Tories, repeatedly complained they had not been informed at the beginning of the week of the government plan to introduce a secret ballot. As a result, many Labour MPs broadly supportive of the Speaker were absent.

Jacob Rees-Mogg, the Conservative MP for North-East Somerset, said he was deeply saddened that Hague “had put his name to a bit of parliamentary jiggery-pokery that has come about from some grudges that people bear to the Speaker”.

David Davis, the leading Tory rightwinger, told MPs he was also opposing the motion on a secret ballot, arguing: “This is a constitutional matter of some importance since it goes to the heart of the relationship between executive and parliament.” He said the planned reform needed to be debated in prime time and “not in a mean-spirited ad hominem manner”.

Hague insisted it was not unusual for amendments to be debated late in the day, and said whether a vote is held by secret ballot could not be construed as an attack on parliamentary democracy.

It was better for MPs to be able “to vote without fear or favour”, he said.

Hague said most Commons committee chairs are elected now by such secret ballots, and claimed there were fearful Labour MPs who did not dare express their criticism of the Speaker. He asserted: “I don’t mind the personal abuse. It is water off the back of this particular duck as I leave the Commons today.”

But Labour MPs laid into the departing Hague both during an urgent question and in the short debate on the issue, with the result that one of the most prestigious parliamentarians of this generation left the Commons under a cloud of controversy.

Angela Eagle, the shadow leader of the house, said: “In my 23 years of parliament I have never seen a government behave in such a grubby and underhand way”, adding that this was “a spiteful attempt to get rid of a Speaker that has the temerity to stand up for parliament”.

Paul Flynn, the Labour MP for Newport, accused Hague of “a mean, spiteful kick at the best reforming Speaker we have had for 30 years”.

A furious Barry Sheerman, the Labour MP for Huddersfield, said the politicisation of the Speaker had come about because “he has opened up the chamber and liberated backbenchers”.

The rightwing Tory Philip Davies, the MP for Shipley, said the tactics of keeping the Conservative parliamentary party at Westminster to discuss the general election, and then staging a surprise unheralded vote on a future secret ballot for the Speaker, “smacked of the kind of student-union politics that has the fingerprints of the whips’ office all over it”.

He said it was sad that the greatest parliamentarian of his generation, Hague, had gone along with these tactics. Another rightwinger, Peter Bone, said Hague would live to regret his manoeuvres.

Gerald Kaufman, the Labour MP for Manchester and the likely father of the house in the next parliament, said “it was grubby, squalid and nauseous” that the amendments had been tabled at the last minute.

It will be for the next father of the house to decide if there was sufficient demand for a contest for the post of Speaker to be held in the next parliament.

A total of 23 Tory MPs and 10 Liberal Democrats voted to reject a secret ballot for the Speaker.

Senior Tories who rejected the proposed ballot included Graham Brady, who is chairman of the backbench 1922 Committee, David Davis, Bernard Jenkin, Cheryl Gillan and Sir Edward Leigh.

Labour whips admitted they might have been unable to muster sufficient numbers if it had not been arranged with the agreement of the Speaker to stage three urgent questions before the vote took place.