Plans to legalise same-sex marriage cleared their crucial hurdle in the House of Lords last night, with peers rejecting a move to “kill the Bill” which will implement the move.

The first gay weddings are now expected to be held in July 2014 after the Marriage (Same Sex Couples) Bill survived an attempt to block it after a heated two-day debate in the Lords.

A wrecking amendment was defeated by 390 votes to 148 and the measure was then given a second reading.

Download the new Independent Premium app Sharing the full story, not just the headlines

Opponents of the move will table amendments during the Bill's committee stage in the Lords, in the hope of winning further safeguards for churches and public servants such as registrars who oppose same-sex marriage.

But last night's big majority will reduce the prospects of them succeeding, and jubilant supporters hope the Bill will now survive largely intact.

Lord Alli of Norbury, a gay Labour peer, welcomed "a stunning victory for equality". He said: "There can be no doubt that the public, the House of Commons and now the House of Lords are in favour of marriage equality. Those opposed to this Bill should listen to the overwhelming voice of the majority, not just in both Houses of Parliament, but across the country."

Ben Summerskill, chief executive of the gay equality pressure-group Stonewall, said: "We're absolutely delighted. We always expected a tough challenge in the House of Lords."

He said the rarely used "fatal motion" tabled by opponents showed the lengths to which a minority of peers were still prepared to go to deny full equality to lesbian, gay and bisexual people.

He added: "In the last 24 hours alone, opponents of equality in the Lords have compared loving, committed relationships to incest and polygamy. Britain's 3.7 million gay people don't deserve to be second-class citizens in their own country."

But critics warned the fight is not yet over. Bob Woollard, chairman of the Conservative Grassroots group, said: "We recognise that others, whilst having reservations about the Bill, were reluctant to take the unusual step of voting it down at this stage. We urge the House of Lords to fulfil its constitutional role to give full and proper scrutiny to this Bill. There is still time for the Government to reconsider this un-Conservative proposal and we look forward to continuing to make the leadership aware of the deep reservations amongst the grassroots about the political and practical implications of this Bill."

Last night's decisive vote was a boost for David Cameron, who was praised by some Labour peers for his "courage" in pressing ahead with gay marriage.

The Prime Minister hopes that now the Bill has received big majorities in both Houses of Parliament, the heat will go out of the debate. He believes that gay marriage will be accepted once it has been introduced, just as opposition to civil partnerships faded quickly after they were allowed.

Although peers do not normally vote against a Bill on its second reading, Lord Dear, a cross-bench peer and former Chief Constable of the West Midlands, tried to stop the measure in its tracks with his wrecking amendment.

He told peers the proposal could "completely alter the concept of marriage as we know it", saying the Bill was "ill-thought-through" and had no democratic legitimacy.

It was so "fatally flawed" that it was incapable of sensible amendment and should be sent straight back to "the drawing board", he argued.

Lord Vinson, a Tory peer, warned that same-sex marriage could create a "moral mess" by fundamentally altering the "most important social structure ever known to mankind". He added: "Fifty years ago those who criticised Christ were persecuted; today those who promote Christ are prosecuted. We need the sort of legal protection that was given to conscientious objectors in the last war – a war that was fought to allow the very freedoms of expressions and thought that are under attack today."

Meanwhile, Baroness Stowell of Beeston, a Government whip and equalities spokeswoman who won praise for her speeches in the debate, said the legislation was a "force for good" which would strengthen the institution of marriage.

She said that if further changes to the Bill were necessary to make protections for religious organisations clearer, the Government would consider doing so.

Lords at war: What they said

Lord Birt: "This brave Bill brings us one historic step closer to a better world."

Lord Mackay: "I conclude that the union... in this Bill is not the institution of marriage but a new and different institution which deserves a name of its own."

Lord Vinson: "If we mix up values and edges are no longer defined, it is like mixing many paints together. The end result is a dull, amorphous moral mess.

Lord Collins of Highbury: "My husband and I have taken every opportunity given to us to celebrate our 16-year relationship on an equal footing in civic society."

Lord Glenarthur: "I fear for the future of family life if this Bill is passed."

Lord Eden: "This bill... is damaging, divisive and destructive."

Baroness Thornton: "It is the personal testimonies, not just of those lords who faced discrimination... but all of those who have spoken of the love and strength they have found through their partners, civil partners, husbands and wives to secure our resolve."