Nonetheless, some Conservative lawmakers added a strident note to Tuesday’s debate.

“It is not possible to redefine marriage,” said Sir Roger Gale, a right-wing backbencher. “Marriage is the union between a man and a woman, has been historically, remains so. It is Alice in Wonderland territory, Orwellian almost, for any government of any political persuasion to seek to come along and try to rewrite the lexicon. It will not do.”

Another discomfited backbencher, Edward Leigh, struck a note that carried a warning for Mr. Cameron, who spoke openly of his support for gay marriage almost as soon as he became the Conservative leader in 2005. “We should be in the business of protecting cherished institutions and our cultural heritage,” Mr. Leigh said. “Otherwise what, I ask, is a Conservative Party for?”

Mr. Cameron is trying to modernize the Conservatives, and to position the party for general elections in 2015, when it will have to battle against a resurgent Labour Party riding high in the polls.

“Today is an important day,” he told reporters at 10 Downing Street before the vote. “I am a strong believer in marriage. It helps people commit to each other, and I think it is right that gay people should be able to get married too.”

“Yes, this is about equality,” he added. “But it is also about making our society stronger.”

A day after the newly confirmed archbishop of Canterbury, Justin Welby, took office saying that he shared the Church of England’s opposition to same-sex marriage, three cabinet officials said in a letter published in The Daily Telegraph that the new legislation was “the right thing to do at the right time.”

“Marriage has evolved over time,” the letter said. “We believe that opening it up to same-sex couples will strengthen, not weaken, the institution.”

The three ministers — George Osborne, the chancellor of the Exchequer; Foreign Secretary William Hague; and Home Secretary Theresa May — also asked whether it was “any longer acceptable to exclude people from marriage simply because they love someone of the same sex.”