(CNN) -- Legislators in Hawaii have passed a civil unions bill that would give same-sex couples the same rights as heterosexual couples.

The state House of Representatives passed the bill by a 31-20 vote late Thursday. Gov. Linda Lingle has until early July to decide whether to sign the bill into law, CNN's Hawaii affiliates reported.

Civil union supporters cheered in the Capitol rotunda when the bill passed, CNN affiliate KGMB-TV in Honolulu said.

"I was always positive even when people were saying it was dead. I stayed positive and worked with a lot of different people that made this happen today," Tambry Young of Equality Hawaii told the TV station.

Lt. Gov. Duke Aiona said lawmakers shouldn't have approved the measure.

"The state House's last-minute political maneuvering is unfortunate for the people of Hawaii who have voiced their support for traditional marriage," he said in a statement. "If the Legislature wanted to establish the equivalent of same-sex marriage, they should have put it on the ballot for the people to decide."

House Bill 444 provides state-level spousal rights to same-sex couples. Voting came as a surprise on the last day of the legislative session, affiliates reported.

In January, House members voted to shelve the bill after Speaker Calvin Say said lawmakers didn't have a veto-proof majority of votes, affiliate KITV-TV in Honolulu reported. House Majority Leader Blake Oshiro, however, called for the measure to be discussed Thursday afternoon, KITV said.

Larry Silva, Catholic bishop of Honolulu, urged people Friday to ask the governor to veto the legislation.

"We need you to mount a campaign to flood the governor's office with requests to veto the bill," Silva wrote on the Diocese of Honolulu's website. "Should the governor veto the bill, they will need 34 votes to override. This is where you come in!"

Supporters such as Equality Hawaii said they hadn't expected a vote Thursday but were pleased with the outcome. Say, the House speaker, said he was proud of having passed the bill.

"I'm happy that it's finally done," supporter Vincent Rosa told KGMB. "The vote was taken and democracy was at work at this capital."

Civil unions advocate Alan Spector told KHON-TV, "I did not know all day this was going to happen. This was a surprise. I'm very happy."

Five U.S. states and the District of Columbia issue marriage licenses to same-sex couples, according to the National Conference of State Legislatures. Hawaii would join New Jersey in allowing civil unions.

Three states -- Rhode Island, New York, and Maryland -- recognize same-sex marriages from other states, according to the conference.

California recognizes same-sex marriages performed during six months in 2008 after its Supreme Court granted same-sex couples the right to marry and before the passage of Proposition 8, which overturned the court's decision.