Out-of-state gay couples should soon be allowed to marry in Massachusetts.

The Massachusetts House voted 118-35 Tuesday to repeal a 1913 law that bans couples from marrying in the state if the unions would not be legal in their own states.

The Senate also voted for the repeal earlier this month, and Gov. Deval Patrick has said he would approve it. The measure required one more procedural vote in each chamber before being forwarded to the governor.

"Sometimes what you hope and pray for actually happens, which is kind of overwhelming," Michael Thorne, 55, of Cape Elizabeth, Maine, said after telling his 6-year-old son his parents could soon get married. Thorne and his partner of 25 years, James Theberge, have an Aug. 18 wedding planned in Provincetown.

Massachusetts was the first state to allow gay marriage, but a 1913 law has barred couples from marrying if the unions would not be legal in their own states. The repeal effort passed after a relatively quick, 40-minute House debate free of the massive protests that accompanied other gay marriage debates in the state.

Repealing the law would allow the state to compete with California, which recently approved gay marriage — with no residency requirement. It could also provide an economic boon, since it would attract gays and lesbians who wanted to formalize their relationship.

In the end, only seven legislators spoke on the issue, four in favor of the repeal, three who wanted to maintain the ban.

Rep. Byron Rushing, D-Boston, said continuing to ban out-of-state gays from marrying was unfair after the state's highest court ruled in 2003 that gay and lesbian couples have a constitutional right to be married.

"This is question of fairness, and it is a question of equity," Rushing said.

Massachusetts allows first-cousins to marry, but half the states in the country do not. Rushing said some first-cousins from out of Massachusetts have undoubtedly been allowed to marry here since 1913.

"The fairness in this question is that we have allowed people to marry in Massachusetts who could not legally marry in their own state for decades, and now we want to change our way we are applying a bit of law we have never enforced. That, I think, is unfair," Rushing said.

Opponents argued repealing the ban amounted to meddling in the affairs of other states and broke with state law and customs that dictated respecting others' marriage rules.

Rep. John Lepper, R-Attleboro, said sanctioning a marriage that is illegal elsewhere would "create a relationship and then set it adrift to settle in a disapproving state."

He spoke of a gay couple from Rhode Island that married in Massachusetts and now is seeking a divorce, saying it was typical of the "legal nightmare" a repeal would create.

"They can't divorce in Rhode Island because the law does not recognize (the marriage)," Lepper said. "They can't divorce in Massachusetts because there is a one-year residency requirement for filing."

Former Republican presidential contender Mitt Romney, who was governor of Massachusetts at the time the court ruled gay marriage was legal, instructed city and town clerks to enforce the long-dormant law once gay marriages started in May 2004.

He argued that repealing the ban would turn the state into the "Las Vegas of gay marriage."

Patrick, who succeed Romney as the state's first Democratic governor in 16 years, as well as its first black chief executive, argued the law carried racial undertones from a time when interracial marriage was discouraged or illegal in some states.