David Cameron got his way but saw his party torn in half as gay marriage legislation cleared its first hurdle in the Commons.

The Prime Minister hailed a "step forward for our country" after the House backed the proposals by a big margin of 400 to 175.

However, Labour and Liberal Democrat support masked a massive show of protest by Tories, with 136 taking advantage of a free vote to register opposition. Just 127 endorsed the proposals at second reading, with 40 more either formally abstaining or not voting.

Environment Secretary Owen Paterson and Welsh Secretary David Jones voted against while fellow Cabinet minister Philip Hammond, the Defence Secretary, and Attorney General Dominic Grieve stayed away.

However, Downing Street will be heaving a sigh a relief after no Government members quit to join a rebellion over the timetabling of the legislation, which involved a whipped vote. Attention will now turn to the Lords, where opponents of the plans are expected to mount tough resistance.

Deputy Prime Minister Nick Clegg said it was a "landmark for equality". He said: "The vote shows Parliament is very strongly in favour of equal marriage. Marriage is about love and commitment, and it should no longer be denied to people just because they are gay."

The result followed more than six hours of stormy debate on the Marriage (Same Sex Couples) Bill. Culture Secretary Maria Miller said the legislation would make England and Wales "a fairer place to live", and insisted religious organisations which did not want to conduct gay marriages had protection.

Asked whether Mr Cameron was disappointed by the scale of the Tory no vote, the Prime Minister's official spokesman said: "Central to the vote was that it was a free vote. The Prime Minister set out his position. He has also acknowledged that there are a range of opinions. He very much respects the opinions of others. It was a matter of conscience, and that is why the right thing to do was to have a free vote."

Mr Paterson told Sky News: "It wasn't discriminatory at all. There was a very good debate, I think it was fair on all sides. But this is an issue of the definition of marriage. I have my idea and many agreed with me but many more did not."

He conceded that the system of civil partnerships - against which he also voted - "is working well" and had "resolved the issues of ownership and hospital visiting". But he added: "I have a clear idea of what the definition of marriage is."