(CNN) - The Iowa Supreme Court unanimously rejected a state law Friday that banned same-sex marriage.
Iowa now will become the third state in the nation to allow same-sex marriage, after Massachusetts and Connecticut.
Friday's decision upheld a 2007 ruling by a lower court that Iowa's 1998 law limiting marriage to heterosexual couples went against the state's constitution. It becomes effective in 21 days.
"This is a great day for civil rights in Iowa," said attorney Dennis Johnson, a co-counsel with Lambda Legal, which filed the lawsuit on behalf of six same-sex couples seeking to marry in Iowa.
"Go get married. Live happily ever after," he said at a news conference where there was loud clapping among plaintiffs.
Other organizations were not pleased.
"It's, quite frankly, a disaster," said Brian English, a spokesman for the Iowa Family Policy Center. "Obviously, we're extremely disappointed. We're saddened. Perhaps a little bit surprised in the unanimous decision that the court handed down."
The state's highest court determined that "the Iowa statute limiting civil marriage to a union between a man and a woman violates the equal protection clause of the Iowa Constitution," court spokesman Steve Davis said in a written statement.
"The decision strikes the language from Iowa Code section 595.2 limiting civil marriage to a man and a woman. It further directs that the remaining statutory language be interpreted and applied in a manner allowing gay and lesbian people full access to the institution of civil marriage," the statement on the court's Web site says.
The Iowa Supreme Court said it has the responsibility to determine if a law enacted by the legislative branch and enforced by the executive branch violates the Iowa Constitution.
"The court reaffirmed that a statute inconsistent with the Iowa Constitution must be declared void, even though it may be supported by strong and deep-seated traditional beliefs and popular opinion," the court said.
Polk County District Judge Robert Hanson earlier determined that the law violated the state constitution's guarantee of equal protection, and hurt gay and lesbian couples "in numerous tangible and intangible" ways.
"Civil marriage in Iowa is the only gateway to an extensive legal structure that protects a married couple's relationship and family in and outside the state," Hanson ruled in Des Moines. "Iowa reserves an unparalleled array of rights, obligations and benefits to married couples and their families, privileging married couples as a financial and legal unit and stigmatizing same-sex couples."
The case was joined on appeal by several state lawmakers who opposed Hanson's ruling, calling it "a mockery of the judicial system."
They argued that the ruling stepped on the state legislature's authority by using the courts "to effectuate fundamental changes in public policieregarding marriage."