Virginia Attorney General Mark Herring has switched sides on the state’s same-sex marriage ban, stating that his cannot support laws that “violate Virginians' rights.”

In Bostic v. Rainey, the plaintiffs, a gay couple, challenged Virginia’s constitutional ban against gay marriage. Herring, who won last year’s attorney general race by a slim margin over Republican candidate State Sen. Mark D. Obenshain, changed his support of the ban after asking his staff to review the case.

"As attorney general, I cannot and will not defend laws that violate Virginians' rights," Herring told NPR’s Morning Edition. "The commonwealth will be siding with the plaintiffs in this case and with every other Virginia couple whose right to marry is being denied."

Herring, a Democrat, voted against marriage equality in 2006 as a member of the state Senate. Since then, conversations with those affected made him see that discrimination also impacted people’s right to marry.

"I was wrong for not applying it to marriage," Herring said. "I saw very soon after that how that hurt a lot of people and it was very painful for a lot of people."

Herring says the ban violates the Equal Protection Clause of the 14th Amendment of the Constitution.

"There have been times in some key landmark cases where Virginia was on the wrong side, was on the wrong side of history and on the wrong side of the law," Herring said. "And as attorney general, I'm going to make sure that the [people] presenting the state's legal position on behalf of the people of Virginia are on the right side of history and on the right side of the law."

The defendants of the Bostic v. Rainey case will still have their arguments heard. 

Sources: USA Today, NPR, Washington Post