The Senate passed the bill on an 18-7 vote, moving it to the House and signaling that the Senate's Democratic majority has enough votes to override a possible veto from Republican Gov. Linda Lingle.
The House has yet to decide if it will vote on the bill. House leaders say they will take up the bill if they have a veto-proof two-thirds majority but may let it die if they have only a small majority.
"It's very close," said Democratic Speaker of the House Calvin Say. "During an election year, this issue is so divisive that it may hurt many of our members."
The bill would grant gay and straight couples the same rights and benefits the state provides to married couples.
Five other states - Colorado, Wisconsin, Maryland, Maine and New Jersey - allow civil unions. Five states - Iowa, Vermont, New Hampshire, Massachusetts and Connecticut - permit same-sex marriage.
Civil union supporters wearing rainbow-colored lei cheered from the Senate gallery when the vote count was announced, while opponents in white shirts and "iVote" buttons quietly walked out.
"I'm very happy. It's not marriage, but it gives us an opportunity to be recognized as a couple," Carlos Quintana of Honolulu said.
The vote follows a rally at the Capitol last weekend attended by thousands of people supporting traditional marriage between a man and a woman. Protesters urged lawmakers to vote down civil unions and promised repercussions during this year's elections to those who didn't.
Lingle has urged the Legislature to drop the issue but hasn't said whether she would sign the measure. The House passed last year's bill but fell one vote short of a two-thirds majority.
"The state Senate is clearly at odds with the people of Hawaii," said Republican Lt. Gov. James "Duke" Aiona, who is running for governor. "Like other movements across the country, voters will have the final say on election day."
Senators said in speeches before the vote that same-sex unions are a matter of basic civil rights. Many compared civil unions to civil rights movements for racial minorities.
"I see nothing in this measure that denies, hurts or harms traditional marriage," said Democratic Sen. Roz Baker. "What I see is an acknowledgment that there are all kinds of families, that there are all kinds of relationships and all of those deserve to be treated equally under the law."
Hawaii's Legislature almost passed civil unions last year when liberal senators forced a vote on the issue following a tied committee vote.
But in the waning hours of the session, the Senate's majority amended the bill so that civil unions could apply to both homosexual and heterosexual couples.
Because that decision came only one day before the Legislature adjourned for the year, a final vote was delayed until this year to satisfy public notice requirements.