SEATTLE -- Two by two, dozens of same-sex couples obtained their marriage licenses in Washington state early Thursday, just hours after Gov. Chris Gregoire signed a voter-approved law legalizing gay marriage.

King County, the state's biggest county, opened the doors to its auditor's office in Seattle just after midnight to start distributing marriage licenses. But hundreds of people had lined up hours earlier, snaking around the downtown Seattle building on a chilly December night. By noon, nearly 400 licenses had been issued in Seattle.

"We knew it was going to happen, but it's still surreal," said Amanda Dollente, who along with her partner, Kelly Middleton, began standing in line at 4 p.m. Wednesday.

Washington state now joins several other states that allow gay and lesbian couples to wed. Gregoire and Secretary of State Sam Reed certified the election on Wednesday afternoon, as they were joined by couples who plan to wed and community activists who worked on the campaign supporting gay marriage.

Because the state has a three-day waiting period, the earliest that weddings can take place is Sunday. Same-sex couples who previously were married in another state that allows gay marriage, like Massachusetts, will not have to get remarried in Washington state. Their marriages will be valid here as soon as the law takes effect.

"This is a very important and historic day in the great state of Washington," Gregoire said before signing the measure that officially certified the election results. "For many years now we've said one more step, one more step. And this is our last step for marriage equality in the state of Washington."

Last month, Washington, Maine and Maryland became the first states to pass same-sex marriage by popular vote. They joined six other states -- New York, Connecticut, Iowa, Massachusetts, New Hampshire, Vermont -- and the District of Columbia that had already enacted laws or issued court rulings permitting same-sex marriage.

Referendum 74 in Washington state had asked voters to either approve or reject the state law legalizing same-sex marriage that legislators passed earlier this year. That law was signed by Gregoire in February but was put on hold pending the outcome of the election. Nearly 54 percent of voters approved the measure.

The law doesn't require religious organizations or churches to perform marriages, and it doesn't subject churches to penalties if they don't marry gay or lesbian couples.