Assembly Speaker Sheila Oliver, D-Essex, hugs Assemblyman Reed Gusciora, D-Trenton, after the bill he sponsored legalizing same-sex marriages passes at the State House in Trenton Thursday.

TRENTON, N.J. — The New Jersey Assembly passed legislation allowing for gay nuptials Thursday, a historic vote that sets the Democrat-controlled Legislature up for a fight with Republican Gov. Chris Christie.

The 80-member Assembly narrowly passed the bill in a 42-33 vote largely along party lines, with four absences and one vacancy. No Republicans supported the bill, which Christie had called on his party to oppose, and four Democrats also voted no. The governor has pledge to override the bill swiftly if it comes to his desk.

“Today I will be standing for equality,” said Assembly Majority Leader Louis Greenwald, a Democrat. “The families of New Jersey cannot afford for us to wait for one minute longer for truly equal treatment under the law.”

The Legislature was packed during Thursday vote, with same-sex marriage supporters wearing blue and opponents dressed in red. Turnout was much greater than Monday, when the state Senate approved the same legislation by 24-16. Two Republicans joined all but two of the upper chamber’s Democrats in supporting the bill.

“The history of marriage as between one man and one woman is an institution that predates any society,” said Father Timothy Christy, the pastor of St. Magdlen de Pazzi Church in Flemington, N.J., who was among the bill opponents. “It is such a deeply held social norm.”

Jan Moore, a 75-year-old resident of Ocean Grove, said she has been with her partner, Emily Sonnessa, for 42 years. ”Our families accept us, our government should accept us,” she said.

New Jersey is one of a number of states now considering gay-marriage measures. In Maryland, the House of Delegates began debate Thursday on legislation that would allow for same-sex nuptials. If passed, the legislation would then move on to the state Senate, where it passed a year ago. Gay-marriage legislation was also introduced in the Illinois Assembly last week.

Seven states and Washington, D.C. now allow for gay marriage. The state of Washington was the latest, with Democratic Gov. Christine Gregoire signing a bill Monday.

New Jersey last tried to pass legislation to allow same-sex couples to marry in 2009, when former Democratic Gov. Jon Corzine said he would sign it if passed. The legislation was struck down in the Senate by a 20 to 14 vote, and it never went before the Assembly.

On Tuesday, Christie called the push by Democrats to pass the legislation in the face of his veto threat a pointless form of “political theater” that is a distraction from the state’s more pressing problems. Once he vetoes the bill, “we can move on to the things in the state that people in New Jersey say are most important,” said Christie, giving lower property taxes and job creation as examples.

The governor has said he wants to put gay marriage up for a referendum, but same-sex marriage supporters argue that a civil right shouldn’t be put to a vote.

If the governor does veto the bill, proponents will have until the end of the legislative session — January 2014 — to wrangle the support for an override vote, which would require 27 votes in the Senate and 54 votes in the Assembly.