Virginia's attorney general formally announced Thursday morning that the state will no longer defend its law banning same-sex marriage.

Attorney General Mark R. Herring says in a brief filed in federal court in Norfolk that marriage is a fundamental right and the ban is discriminatory.

"After a thorough legal review of the matter, Attorney General Herring has concluded that Virginia's current ban is in violation of the U.S. constitution and he will not defend it," spokesman Michael Kelly wrote.

This will not end the legal challenge now pending in the state — a lawsuit brought on behalf of gay couples in the state by the two lawyers who challenged Prop 8 in California — Ted Olson and David Boies. Two Virginia counties are still parties to the case, and they will continue to defend the state ban.

The move comes following a seismic political shift in Virginia that ushered Democrat Terry McAuliffe into the governor's office and Herring, a Democrat who campaigned in part on marriage equality, as attorney general.

Herring's victory was razor thin and was only official after a recount showed he earned 165 more votes than his Republican foe in a race with more than two million votes cast.

Virginia voters approved the same-sex marriage ban 57 percent to 43 percent in 2006. But a Quinnipiac University poll in July found that 50 percent of registered Virginia voters support same-sex marriage, while 43 percent oppose it. The survey's margin of error was plus or minus 3.1 percentage points.