U.S. District Judge Arenda Wright Allen stayed her decision so that it can be appealed, and so same-sex marriages in the commonwealth will not begin immediately. Virginia Attorney General Mark R. Herring, a Democrat who had switched the state’s legal position on the issue and joined two gay couples in asking that the ban be struck down, has said the state will continue to enforce the ban until the legal process is over.

“Gay and lesbian individuals share the same capacity as heterosexual individuals to form, preserve and celebrate loving, intimate and lasting relationships,” Wright Allen wrote. “Such relationships are created through the exercise of sacred, personal choices — choices, like the choices made by every other citizen, that must be free from unwarranted government interference.”

Wright Allen opened her decision with a quote from Mildred Loving, who was at the center of the Virginia case that the Supreme Court used in 1967 to strike down laws banning interracial marriage.

Wright Allen added: “Tradition is revered in the Commonwealth, and often rightly so. However, tradition alone cannot justify denying same-sex couples the right to marry any more than it could justify Virginia’s ban on interracial marriage.”

At issue in the case is a question the Supreme Court justices left unanswered in June in their first consideration of gay marriage: Does a state’s traditional role in defining marriage mean it may ban same-sex unions without violating the equal protection and due process rights of gay men and lesbians?

The case in Wright Allen’s courtroom marked the first time such a challenge has advanced so far in a state that was part of the Old South.

Herring infuriated Republicans and conservatives in the state when he decided soon after taking office last month that he would not defend the ban.

The law was defended last week in a hearing before Wright Allen by lawyers representing circuit court clerks in Norfolk and Northern Virginia’s Prince William County, who issue marriage licenses.

The lawsuit was brought on behalf of two Virginia couples. Timothy Bostic and Tony London have lived together for more than 20 years and were denied a marriage license last summer by the Norfolk Circuit Court clerk. Mary Townley and Carol Schall of Chesterfield County were married in California and have a teenage daughter. They want Virginia to recognize their marriage.

Wright Allen’s decision was similar to what federal judges in Utah and Oklahoma have used in striking down same-sex marriage bans in those states. Same-sex marriages took place in Utah, but both decisions are now stayed pending appeal.

Another judge in Kentucky this week said that state must recognize same-sex marriage performed in other states.

The highest courts in New Jersey and New Mexico have held that same-sex couples have the right to be married there. Seventeen states, including Maryland but not counting Utah and Oklahoma, now allow such unions.