HONOLULU — The State House of Representatives passed a bill late Friday to legalize same-sex marriage, all but ensuring that Hawaii will soon join 15 other states and the District of Columbia in allowing gay couples to wed.

After 12 hours of heated debate, the House approved the measure on a 30-to-19 vote. The bill will now be sent to the State Senate, which approved same-sex marriage by a wide margin but must accept revisions in the House version for the measure to become law.

Gov. Neil Abercrombie, a Democrat who called a special session of the Legislature to address the issue, praised the House action and indicated that he would quickly sign the legislation when it reached him. “I look forward to a successful conclusion to this major step in affirming everyone’s civil rights,” Mr. Abercrombie said in a statement issued late Friday night.

As members of the largely Democratic House debated, they could hear opponents outside chanting, “Let the people decide.”