Raising the contentious issue of same-sex marriage in a state with the first caucus of the 2008 presidential campaign, an Iowa district court judge ruled the state's Defense of Marriage Act unconstitutional this week but enacted a stay on his own ruling less than 24 hours later.

The ruling by Iowa District Court for Polk County Judge Robert Hanson on the act -- which defines marriage as between a man and a woman -- stood long enough for one gay couple to get married.

Iowa State University undergraduates Sean Fritz and Tim McQuillan found a pastor, made their hurried vows and returned to the county recorder's office for a marriage certificate before the stay went into effect, said Polk County recorder Julie Haggerty.

Hanson's ruling was filed with the court clerk at 1:53 p.m. CDT on Thursday and stayed at 12:27 p.m. Friday, after a Polk County attorney filed an appeal to the state Supreme Court. In the nearly nine business hours in which same-sex marriage was legal here, almost two dozen other couples applied for licenses.

Some Iowa lawmakers said the judge's ruling would shape the presidential campaign in the coming months. Iowa's caucus is scheduled for Jan. 14.

"As the caucus get closer, it's all anyone's going to be talking about," said state Rep. Christopher Rants, Iowa Republican House minority leader. "Because this is not about whether civil unions are legal. This is not about transferring property rights or making sure domestic partners have medical benefits. This is about marriage."

Though Massachusetts is the only state that allows same-sex marriage, nine other states have approved spousal rights for same-sex couples, according to the National Conference of State Legislatures. More than two dozen states have a constitutional definition of marriage as being between a man and a woman. In California, the State Supreme Court is weighing the state's ban on same-sex marriage.

In 2005, six gay and lesbian couples sued, saying that Iowa's 1998 Defense of Marriage Act violated their state constitutional rights of equal protection and due process.

In his 63-page opinion, Hanson agreed. The law reflected "old and over-broad stereotypes that do not reflect the diversity of individual men and women," Hanson wrote. Marriage laws must be "read and applied in a gender-neutral manner, so as to permit same-sex couples to enter into a civil marriage."

"We're thrilled with the decision," said former Iowa Solicitor General Dennis Johnson, who is on the couples' legal team. "These couples have the right to not be treated like second-class citizens."

For McQuillan, 21, and Fritz, 24, there was more rush than romance Friday.

McQuillan, a linguistics major, and Fritz, who's studying computer science, had been dating for a year when they heard the news. Fritz proposed Thursday night. McQuillan said yes.

The next morning, the pair drove from Ames to the Polk County recorder's office. Joining other same-sex couples, the men filled out the paperwork for a marriage license, paid $5 to waive the normal three-day waiting period, and found a judge to sign the waiver form.

The Rev. Mark Stringer, 40, of the First Unitarian Church of Des Moines said, "They found me just rolling out of bed.

"We don't usually do shotgun weddings, but it was a crazy situation."

The couple explained the situation and begged Stringer to marry them -- fast. They expected Hanson's decision to be appealed.

Stringer told them to come to his house and there, beneath a maple tree, before family members who had accompanied them and more than a dozen reporters, the two men exchanged rings and kissed.

"We're married," Fritz told the attendees.

Less than an hour after the couple received their marriage license, Hanson put a hold on his ruling, pending the appeal.

Dennis Goldford, a professor of politics at Drake University in Des Moines, said the ruling could help rally social conservatives to the polls.

He said some Republican candidates were banking on hot-button issues like this to rally socially conservative voters who had been unenthusiastic about the party's candidates.

The ruling, he said, could cause concern for the Democratic Party, whose presidential candidates have generally voiced their support for civil unions and domestic partnerships -- but less receptive of same-sex marriage.