RICHMOND, Va. — As the sun set in Richmond on Monday, Virginia Attorney General Mark Herring was talking about all the times the person who has sat in his seat has been on the wrong side of history.

The U.S. Court of Appeals in Richmond will consider on Tuesday whether Virginia's constitutional ban on same-sex couples' marriages violates the U.S. Constitution. And, unlike those former attorneys general, Herring believes that in choosing not to defend the law — and, in fact, arguing that the ban is unconstitutional — that he is on the right side of history.

"I looked at the brief that [former Virginia Attorney General Ken] Cuccinelli's office had filed" in the challenge to Virginia's marriage ban passed in 2006, Herring, a Democrat, said. "I had read large pieces of some of the briefs that were filed in some of the cases that Virginia was on the wrong side of decades ago, like the Brown v. Board Education cases. Prince Edward County in Virginia was one of those [school districts in the case], where the attorney general of Virginia argued the wrong position. And, same with Loving v. Virginia, same with the [Virginia Military Institute] case," where VMI's single-sex admissions policy was declared unconstitutional.

Sitting in his office overlooking the state capitol on Monday evening, Herring talked with BuzzFeed about how he made the decision not to defend the law in this case — Bostic v. Schaefer — and what difference he thinks it makes that he has done so.

Knowing that cases had been filed challenging the constitutionality of the 2006 amendment, Herring said that during his campaign what he would do as attorney general would be to bring together legal experts in the office to look at the ban, study their analysis independently, and then make a decision about its constitutionality. "And I also said that I did not think attorneys general should be defending laws that they concluded were unconstitutional," he said.

"That's exactly what I did — after the recount concluded," Herring said of the 43-day period when his race against Republican Mark Obenshain had been too close to call and then been subject to a recount sought by Obenshain.

But, when Herring was declared the winner — under a court order that he has framed and is hanging on the wall of his office — he got to work on the issue quickly. After naming Stuart Raphael his solicitor general, the top appellate lawyer in the office, Herring said he put Raphael — who left his job as a partner at Hunton & Williams for the role — in charge of the review.

"I tasked him with the job of leading a team to do that legal analysis and coming back to me with that research so that we could work together to come to a legal conclusion — and you know what I concluded: It's unconstitutional, violates due process and equal protection clauses of the 14th Amendment," Herring said, adding, when asked, that Raphael had reached the same conclusion in his analysis.

"And the more I looked at it, the more firmly convinced I became of that," he said, talking about the prior cases when Virginia "was on the wrong side" of history. "I felt very confident of our legal analysis, and given the strength of our legal analysis, given my firm belief that this is a fundamental right that's being denied to thousands of Virginia couples, and our own unique history, I was compelled to change the state's legal position."

And though "there was immediate criticism from some predictable circles," he said the bigger response came from those who supported his decision. "Some of the most moving conversations I've had, a lot of times, in the days following that, were from parents who came up to me — people I didn't know — who came up to me and said, first, that they wanted to thank me for what I'd done and, second, they told me that the day I made the announcement, that they got a call from their son or their daughter, in tears, because of what it meant to them to have their state's attorney general stand up, do what's right, and to fight for them and their rights."

After making the change in position, the case went forward, and on Feb. 13, U.S. District Court Judge Arenda Wright Allen found the ban unconstitutional, opening with a statement from Mildred Loving — the woman who successfully challenged Virginia's law banning interracial couples from marrying in Loving v. Virginia — declaring her support for the right of same-sex couples to marry at the opening of her opinion.

That case — brought by lawyers at the law firm of Shuttleworth, Ruloff, Swain, Haddad & Morecock in Virginia who have since been joined by Ted Olson and David Boies and the American Foundation for Equal Rights — is being heard on appeal by a three-judge panel of the 4th Circuit Court of Appeals on Tuesday. The ruling, Herring noted, will be legal precedent that applies to Virginia, Maryland, West Virginia, North Carolina, and South Carolina — although he believes the Supreme Court will soon take a case to resolve the issue nationwide. "I think they have to," he said.

The 4th Circuit comes first, though, and it has been seen as one of the more conservative circuits in the country, with some of the most conservative appellate judges in the country counted among its members, although that trend has shifted recently with several appointees from President Obama now on the court. And while the three-judge panel hearing the case won't be made public until 7 a.m. Tuesday, Herring said that shouldn't make a difference in the ultimate outcome of the case.

"The legal principles apply just the same, and I keep coming back to the changing legal landscape. This is a legal case, this is a court of appeals in federal court, and it should be based more on what the law is. I come back to the Windsor case [striking down part of the Defense of Marriage Act], and what Justice [Anthony] Kennedy said, writing for the majority, which is that laws that treat same-sex couples as second-class citizens violate due process and equal protection."

"In my opinion," Herring said of Tuesday's panel, "if they're thinking carefully about the most recent precedent, they'll see the direction that I think the Supreme Court is headed — regardless of who the panel is."

Despite the strong feelings he expressed about what he believes about that direction, he also sidestepped a question about whether he thought attorneys general defending their state's similar marriage bans — including fellow Democratic attorneys general Roy Cooper of North Carolina and Dustin McDaniel of Arkansas.

"I think different attorneys general approach decisions like this differently," he said. Noting all of the specific facts of the cases in Virginia — and Virginia's history on civil rights cases throughout the state's history — Herring said, "All of those things together led me to the conclusion that this was the right thing to do for Virginia at this particular time in this particular case. As to what other AGs do in cases in other states, they have to make up their own minds on that."

But, on Tuesday, Herring and Raphael will be sitting in the courthouse just down the block from Herring's office, and Raphael will be arguing that the appeals court should strike down the ban that voters of the state put in place less than eight years ago.

"I think it's going to be an interesting day," Herring said. "I think it's going to be a good day for Virginia."