Gov. Neil Abercrombie, who called lawmakers to a special session for the bill and has vocally supported gay marriage, said in a statement he will sign the measure. It will allow thousands of gay couples living in Hawaii and even more tourists to marry in the state starting Dec. 2.
"I look forward to signing this significant piece of legislation, which provides marriage equity and fully recognizes and protects religious freedoms," Abercrombie said.
President Barack Obama praised the bill's passage, saying the affirmation of freedom and equality makes the country stronger.
"I've always been proud to have been born in Hawaii, and today's vote makes me even prouder," Obama said.
Senators passed the bill 19-4 with two lawmakers excused. Cheers erupted inside and outside the gallery when the vote was taken, with a smattering of boos. Senate President Donna Mercado Kim, who voted against the bill, banged her gavel and told members of the public to quiet down.
More than half the chamber's lawmakers spoke in support of the bill, with many urging the public to come together to heal divisions within the community.
"This is nothing more than the expansion of aloha in Hawaii," said Sen. J. Kalani English, a Democrat from Maui.
Sen. Sam Slom, the chamber's only Republican, said the government should stay out of legislating marriage.
"People have differences, and you can't legislate morality. You can try, but you can't do it," Slom said before voting against the bill.
An estimate from a University of Hawaii researcher says the law will boost tourism by $217 million over the next three years, as Hawaii becomes an outlet for couples in other states, bringing ceremonies, receptions and honeymoons to the islands. The study's author has said Hawaii would benefit from pent-up demand for gay weddings, with couples spending $166 million over those three years on ceremonies and honeymoons.
The Senate took up the bill a second time because of changes made in the House, where the bill was amended and eventually passed.
The House amendments delayed the dates ceremonies could begin, slightly expanded an exemption for clergy and religious organizations, and removed regulations determining how children of same-sex couples could qualify for Native Hawaiian benefits.
Sen. Clayton Hee, who steered the bill's passage in the chamber, said the measure was good even though he believes the religious protections granted are too broad. He said the final bill was a good compromise.
"It is landmark legislation, the weight of which is on the freedom to marry," Hee said. "The give was broader religious decision-making."
The measure is the culmination of more than two decades of debate in the state, where two women in 1990 famously applied for a marriage license, touching off a court battle and eventual national discussion on gay marriage.
The case led to Congress passing the Defense of Marriage Act in 1996, part of which was struck down earlier this year by the U.S. Supreme Court. The decision that legally married same-sex couples could qualify for federal benefits led Abercrombie to call the special session in Hawaii.
The Senate vote puts Hawaii alongside Illinois, where a bill legalizing gay marriage is also awaiting the governor's signature. Another 14 states and the District of Columbia already allow same-sex marriage.
Officials in Abercrombie's office said details of a signing ceremony for Hawaii's measure were still being finalized.