Gov. John Baldacci (D-Maine) has signed a law legalizing same-sex marriage in his state. The bill cleared the legislature just hours before.

Baldacci has previously opposed same-sex marriage, supporting civil unions instead. Today he changed his view.

"In the past, I opposed gay marriage while supporting the idea of civil unions," Baldacci said in a statement. "I have come to believe that this is a question of fairness and of equal protection under the law, and that a civil union is not equal to civil marriage."

The Senate passed the legislation 21-13 earlier today. The House voted 89-57 in favor of the bill yesterday.

Maine joins Iowa, Vermont, Connecticut and Massachusetts as the only states where same-sex marriage is legal. The New Hampshire legislature passed a bill legalizing same-sex marriage last week. It's unclear whether Gov. John Lynch (D) will sign it .