A move by Tory hardliners to stop the repeal of the controversial Section 28 rule which bans the promotion of homosexuality by local councils - including schools - was heavily defeated in the House of Commons.
Section 28 was introduced under Margaret Thatcher
The amendment to the Local Government Bill, tabled by Tory former ministers Ann Widdecombe and Edward Leigh, was rejected by 368 votes to 77. Majority 291.
Tory leader Iain Duncan Smith was among 71 Tory MPs who backed the move to block repeal of Section 28. Some 23 Tory colleagues voted against the bid.
The amendment, on a free vote, showed how deep the divisions were between hardline Tory MPs and the modernising wing of the party.
One of the finer things MPs will be doing this year ... is ridding the Statute Book of this nasty, pernicious piece of legislation
The government has already secured an amendment in the Committee Stage of the Local Government Bill to get rid of Section 28.
The measure was introduced in the original 1988 Local Government Act, when Margaret Thatcher was Tory prime minister and has become a focal point for equal rights campaigners.
The Opposition front bench proposed a "compromise" plan to make the repeal subject to a review every two years to see if safeguards and parental ballots needed to be put in place.
Mr Leigh and Miss Widdecombe's amendment faced strong opposition from some Conservatives, including John Bercow, who stepped down from the Tory front bench over the party's line on gay adoption rights.
"In an age of pervasive cynicism about Punch and Judy politics, it is important not to oppose for the sake of opposing ..." he said during the two and a half hour debate.
He stressed that he would be backing the repeal of Section 28 and against the "obnoxious amendments" tabled by Conservative MPs.
Davey: Section 28 is 'ripe for repeal'
Labour MP Shaun Woodward - who defected from the Tories over their stance on the issue - told the House of Commons that the measure had "damaged people".
He said that "one of the finer things MPs will be doing this year in our legislation is ridding the Statute Book of this nasty, pernicious piece of legislation".
Geoffrey Clifton-Brown, the shadow local government spokesman, putting forward the compromise, argued that there were "a lot of misapprehensions and misnomers" about the repeal of Section 28.
"This matter is entirely a matter about protecting our children in schools," he said.
"We can all argue about the content of sex education. I think very few would argue that we should have no sex education at all, it's a question of how it should be done."
Mr Clifton-Brown said his party was proposing a "strong compromise" to protect children.
I believe that Section 28 ... was brought in to make a declamation that homosexuality was abnormal, immoral and wrong
"We've got to have appropriate safeguards in place."
Local Government Minister Nick Raynsford described Section 28 as an "unnecessary piece of legislation," that many found "deeply offensive".
"It stigmatises certain lifestyles. It is widely perceived
as discriminatory and it has caused offence and confusion for long enough," he said.
Repealing Section 28 would send a "powerful message, which I hope will be
echoed tonight and listened to very carefully in the Lords" he said.
Labour MP Chris Bryant, ordained as a priest in 1987, described Section 28 as an "immoral piece of legislation", designed to be "offensive".
"I believe that Section 28 ... was not brought in seriously to protect children. It was brought in to make a declamation that homosexuality was abnormal, immoral and wrong."
Labour MP David Borrow dismissed the suggestion that homosexuality could
"For me and many other gay men and lesbians Section 28 ... is something we find
deeply offensive," he said.
But Mr Leigh insisted: "Section 28 is a statement that there is no moral equivalence between
homosexuality and heterosexuality. I make that moral statement in the knowledge
that many other people in this country believe it to be true."
Speaking ahead of the debate, Edward Davey, Liberal Democrat spokesman for the Office of the Deputy Prime Minister, said: "Never has a piece of legislation been so ripe for repeal."
The measure still has to go to the House of Lords where more opposition from Tory peers is expected.