The Government's controversial plans to legalise gay marriage have cleared the Commons despite efforts by Tory backbenchers to derail the legislation.

There was applause in the after MPs voted by 366 to 161, majority 205, to give the Marriage (Same Sex Couples) Bill a third reading.

The legislation will go to the House of Lords after the half-term recess where it is expected to attract fierce opposition from peers, especially the bishops.

The result is a marginal improvement for David Cameron on the vote at second reading when 175 MPs opposed the plans in a Commons vote. It also comes as a relief for Downing Street following a serious attempt on Monday by Tory former minister Tim Loughton to derail the Bill. Mr Loughton had tabled an amendment extending civil partnerships to straight couples - a move which ministers warned could have cost the Treasury an extra £4 billion in pension liabilities and scupper the chances of the Bill becoming law.

But Labour - mindful they did not want to play any part in derailing the Bill - decided against supporting Mr Loughton - a move which would have seen the amendment pass - and offered the Government an 11th-hour deal to immediately review the possibility of extending civil partnerships to straight couples. Secretary Maria Miller accepted their amendment and Mr Loughton's amendment in the end was easily defeated.

Turning to Ms Miller shortly before the vote, shadow minister for women and equalities minister Yvette Cooper said: "We can only wonder what would happen if you and I leapt up and started leading a Eurovision-style chorus perhaps of congratulations perhaps Abba-style, maybe not 'One Man, One but certainly 'I Do, I Do, I Do'.

"I have heard Conservative members talk about the anger in their constituencies. And I hope they will now be able to stop talking about the anger and start talking about the joy. Because this is about the joy that we can deliver to those that want to get married just as their did. Let's be loud and proud, let's start the singing. Let's celebrate, not discriminate. Let's put aside the anger and hear it for the joy."

Earlier, Sir Tony Baldry - the senior Tory MP who represents the Church of England in the Commons - said he already had enough problems trying to persuade voters in his rural Oxfordshire constituency of Banbury about the need to legalise gay marriage. The Second Church Estates Commissioner said: "I can't speak for other MPs, but I have had enough problems in my constituency with same-sex marriage." In a heated debate on Monday a number of MPs, many of them Conservative backbenchers, stood up to denounce the Government's plans. Conservative former defence minister Sir Gerald Howarth said he believed there was an "aggressive homosexual community" who saw gay marriage as a "stepping stone to something even further".

Two Tory cabinet ministers - Welsh Secretary David Jones and Environment Secretary Owen Paterson - voted against the Bill at third reading. They were joined by 10 junior ministers: minister without portfolio John Hayes, Solicitor-General Oliver Heald, transport minister Simon Burns, Europe minister David Lidington, defence minister Philip Dunne, defence minister Andrew Robathan, defence minister Francois, justice minister Jeremy Wright, and Northern Ireland minister Mike Penning and work and pensions minister Esther McVey. General's Office)