Iowa is the third US state to legalise same-sex marriages
Iowa's Supreme Court has ruled that a ban on same-sex marriages in the US state was unconstitutional.
The judges rejected an appeal against a lower court's 2007 ruling that the ban violated the rights of gay men and women in the state.
The case stems from a 2005 suit filed by a New York-based gay-rights group on behalf of six gay and lesbian couples.
Iowa becomes the third US state to allow same-sex marriages, joining Connecticut and Massachusetts.
Other states allow civil partnerships or other unions, but these do not carry the same legal weight as marriages.
In its summary, the Supreme Court said the ruling "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".
It said the ruling would remove language from Iowa's legal code which limited marriage to being between a man and a woman.
Remaining statutes must also be "interpreted and applied in a manner allowing gay and lesbian people full access to the institution of civil marriage", the court said.
Dennis Johnson, a lawyer for the plaintiffs, said it was "a great day for civil rights in Iowa".
"We have all of you courageous plaintiffs to thank: Go get married, live happily ever after, live the American dream," he said.
Polk County Judge Robert Hanson had ruled in 2007 that Iowa's 1998 Defense of Marriage Act, defining marriage as solely between a man and a woman, violated the couples' constitutional rights.
California briefly legalised same sex marriage in 2009
But on the same day, Polk County Attorney John Sarcone filed an appeal arguing that the issue should be left to the legislature - that appeal has now been rejected.
The Associated Press reported that Mr Sarcone would not ask for a rehearing, meaning the court's decision should take effect in three weeks' time.
Lambda Legal, which filed the case, said the couples cited had been together for between five and 16 years and three of them had children.
The group had said the couples wanted "the responsibilities of marriage and the protections only marriage can provide".
It said the couples' children and any future children should have the right to "have their families treated fairly".
Iowa is the first state to legalise gay marriage in the US Midwest - traditionally a more conservative area of the country.
Analysts said the ruling showed acceptance of same-sex marriage was becoming more mainstream.
The state of California briefly legalised same-sex marriage in 2008.
Thousands of couples were married before the ruling was overturned by a referendum in November.