Supporters maintained there was no fundamental right to gay marriage and the ban exists as part of the state's interest in responsible procreation.
"We have marriage laws in society because we have children, not because we have adults," said attorney David Nimocks, of the religious group Alliance Defending Freedom.
The case is being closely watched because it could give the gay marriage movement its first foothold in the South, and because legal experts think it's on the fast track to the U.
Recently elected Virginia Attorney General Mark Herring, a Democrat, announced Jan. 23 that he would not defend the ban because he thinks it violates the equal protection clause of the 14th Amendment.
Federal judges have cited the 14th Amendment in overturning gay marriage bans in Utah and Oklahoma. Those rulings are on hold while they are appealed.
Herring, as a state senator, supported Virginia's 2006 voter-approved constitutional amendment defining marriage as the union of a man and woman. His change illustrates how rapidly the political and legal landscape on gay marriage in the U.S. is shifting.
Herring's chief litigator, Solicitor General Stuart Raphael, told U.S. District Judge Arenda L.
Raphael said supporters have failed to prove how allowing gay marriage would make heterosexual couples less likely to marry.
"That's the Achilles heel in the argument," he said.
Before the hearing, dozens of demonstrators at the courthouse shouted phrases decrying Herring's position.
Across the street, a much smaller group yelled their support for gay marriage and carried signs saying: "Marry who you love," which drew honks of support from drivers passing by.
The judge said she would rule soon. Wright Allen is a former public defender and assistant U.S. attorney who was appointed to the post by President Barack Obama.
After Herring's office decided not to defend the law, Wright Allen considered not even hearing verbal arguments because of the "compelling" filing by the attorney general's office.
If Wright Allen finds Virginia's law unconstitutional, Raphael asked her to issue a stay so that nobody can get married until the case is heard on appeal. He said the state wanted to avoid the situation Utah found itself in after marriages were briefly allowed to occur there.
Legal experts said Virginia's fast-track federal court system could hasten a certain appeal to the U.S. Supreme Court and perhaps a landmark ruling.
The Eastern District of Virginia has long had a reputation for bringing cases to trial quickly under a so-called rocket docket. Virginia is also home to the 4th U.S. Circuit Court of Appeals, which has evolved from one of the nation's most conservative appellate courts to a moderate bench with Obama nominating six judges. It also has a track record for speedy appellate decisions.
Yale Law School Professor William Eskridge, an expert on gay rights, said the Supreme Court could take up the case in its next session, which begins in October and ends in around early summer 2015.
"The attorneys for the plaintiffs would like their case to be the next one that goes to the U.S. Supreme Court," he said.
With Herring's office fighting the ban, the job of defending the law fell to the legal team of Norfolk's Circuit Court clerk.
Attorney David Oakley said the court should respect the legislative process that created the law and if it is to be changed, it should be done by the General Assembly or by a vote of the people. The attorney for Alliance Defending Freedom argued on behalf of the Prince William County's clerk, which was allowed to intervene.
Herring attended the hearing but did not speak. At a later news conference, he dismissed criticisms that he was ignoring his responsibility to defend the state constitution. He said he also swore to uphold the U.S. Constitution, and he believes they conflict in this case.
The lawsuit challenging the ban was filed on behalf of Norfolk couple Timothy Bostic and Tony London, who were denied a marriage license by the Norfolk Circuit Court on July 1.
Since then, a Chesterfield County couple, Carol Schall and Mary Townley, have joined the case. The couple married in California in 2008. They have a teenage daughter and want Virginia to recognize their marriage.
The attorneys representing the plaintiffs on behalf of the American Foundation for Equal rights are the same ones that successfully challenged California's ban on gay marriage.
The lawsuit was filed shortly after the U.S. Supreme Court struck down the section of the federal Defense of Marriage Act that prevented gay couples from receiving a range of federal benefits that are generally available to married people.
Currently 17 states and the District of Columbia allow gay marriage. Most are clustered in the Northeast; none is in the former Confederacy.
Nationwide, there are more than a dozen states with federal lawsuits challenging state bans on same-sex marriage.
Associated Press writer Steve Szkotak in Richmond contributed to this report.
Brock Vergakis can be reached at http://www.twitter.com/BrockVergakis