RICHMOND, Va. — Almost overnight, Virginia has emerged as a critical state in the nationwide fight to grant gay men and women the right to wed.

This purple state was once perceived as unfriendly and even bordering on hostile to gay rights.

Additional Photos

That’s changed after a seismic political shift in the top three elected offices, from conservative Republicans to liberal Democrats who support gay marriage.

Two federal lawsuits challenging the state’s constitutional ban on gay marriage are moving forward, and a hearing on one of the cases is scheduled for Jan. 30.

With the recent court gains in Utah and Oklahoma, gay rights advocates are heartened by the new mood in Virginia. Symbolically as well, they say, the challenges of the state’s gay marriage ban resonate because of the founding state’s history of erecting a wall between church and state and a landmark U.S. Supreme Court decision involving a Virginia couple and a past taboo: interracial marriage.

“Virginia is one of several important battlefronts where we have the opportunity now to build on the momentum, embrace the public’s movement in favor of the freedom to marry and end the discrimination,” said Evan Wolfson, founder and president of New York-based Freedom to Marry, which seeks to have same-sex marriage bans struck down nationwide.

With the election of Gov. Terry McAuliffe and Attorney General Mark Herring, the state made a hairpin turn away from the socially conservative officeholders they succeeded, particularly Republican Attorney General Ken Cuccinelli, an activist on social issues such as abortion and gay marriage. Herring had campaigned, in part, on marriage equality, and McAuliffe issued an executive order on inauguration day prohibiting discrimination against state employees who are gay.

Democratic legislators, still widely outnumbered in the House of Delegates, have also been emboldened by the shift away from a reliably conservative state. They took immediate aim at the state’s ban on gay marriage, but proposed constitutional amendments face a long road. The earliest voters could see a proposed amendment is in 2016.

The separate lawsuits intended to topple the constitutional ban on gay marriage have been filed in federal courts, which are typically speedy in Virginia. The issue could ultimately be appealed to the U.S. Supreme Court.

One lawsuit, filed in U.S. District Court in Harrisonburg, involves two couples from the Shenandoah Valley who claim the state’s ban on gay marriage violates the Constitution’s equal protection and due process clauses. The American Civil Liberties Union and Lambda Legal are representing the plaintiffs.

Camilla Taylor, marriage project director for Lambda Legal, said Virginia’s “intriguing” history on marriage rights played a role in filing the challenge here. A 1967 Supreme Court decision involving a Virginia couple invalidated laws on miscegenation, or interracial marriage .

The case involved Mildred and Richard Loving. The interracial couple had been living in Virginia when police raided their home in 1958 and charged them with violating the state’s Racial Integrity law. They had been married in Washington, D.C.

The Lovings were convicted before ultimately prevailing before the Supreme Court.

Send questions/comments to the editors.