Image copyright Ashley Ramkishun Image caption Samuel Sarfo and Ashley Ramkishun have lived in Virginia for 10 years

Couples in the US state of Virginia will no longer have to declare their race in order to get a marriage certificate, its attorney-general says.

Mark Herring issued new legal guidance after three couples filed a lawsuit calling the statute "unconstitutional" and "reflective of a racist past".

Some options on forms included Aryan, Moor, Octoroon and Mulatto.

A lawyer for the couples welcomed the move but said they wanted to fight on to remove the law altogether.

Mr Herring issued the guidance in emails on Friday to legal clerks and the media.

Marriage licence applicants can now choose to opt out of the question stating their race.

Mr Herring said in a statement: "We were happy to help quickly resolve this issue and get these couples what they asked for. These changes will ensure that no Virginian will be forced to label themselves to get married."

He said the guidance followed the principle "that statutes should be construed to avoid any conflict with the constitution".

He added: "I appreciate the courage these couples showed in raising this issue, and I wish them all the best in their lives together."

The three couples in the lawsuit are Brandyn Churchill and Sophie Rogers; Ashley Ramkishun and Samuel Sarfo; and Amelia Spencer and Kendall Poole.

Lawyer Victor M Glasberg filed the lawsuit on their behalf and said it should continue until the law was ruled unconstitutional.

Image copyright Brandyn Churchill/Sophie Rogers Image caption Brandyn Churchill and Sophie Rogers were one of three couples to file the lawsuit

He told the Washington Post the new guidance was "welcome, it's much appreciated, and it's the right thing to do as an initial response. But the statute is obnoxious and... we need to get rid of the statute".

Ms Ramkishun told the paper: "It doesn't resolve the fact that there's still a law in place in Virginia. The state could change its mind at any point in regards to whether the race question is optional or not."

Mr Churchill told the BBC that when he and Ms Rogers applied for a licence in Rockbridge County they found that "many of the categories were outdated, offensive racist terms which have no place in the 21st Century. We said we were uncomfortable and left".

Image copyright Victor M Glasberg Image caption Lawyer Victor M Glasberg has been pondering a challenge for many years

Mr Glasberg told the BBC he had been mulling a challenge for many years. When he got married in 1981, he asked if he could put "human" down in the category but was told no.

Virginia is one of eight states in the US with the legal requirement to identify race prior to marriage.