A federal judge ruled Friday that Virginia’s law requiring the disclosure of race on marriage license applications is unconstitutional.

“Requiring Plaintiffs to disclose their race in order to receive marriage licenses burdens their fundamental right to marry,” U.S. District Judge Rossie D. Alston Jr. wrote in a 19-page ruling that bars Virginia from enforcing the requirement.

Sophie Rogers and Brandyn Churchill, a Lexington couple hoping to marry in Virginia on Oct. 19, refused to answer the race question on their marriage license application. They and two other couples filed suit in federal court challenging the constitutionality of the question.

Last month, Attorney General Mark Herring notified clerks around the state that while they were required to collect race and other personal data, there was no specific requirement that the applicants have to give it. There also is no provision that says what happens if the applicants decline to provide race information, Herring wrote.

Herring wrote last month that it was his opinion that clerks should issue a license regardless of an applicant’s answer or non-answer to the race question. A new marriage form was sent to the clerks that makes it clear applicants can decline to answer the question about race.

Victor M. Glasberg, a civil rights lawyer in Alexandria who filed the suit, said Friday, “We’re very pleased, of course. The only unfortunate part is that it took a United States district judge to strike a Jim Crow provision that the state of Virginia insisted on defending in court.”

A spokesman for Herring said Alston’s ruling was consistent with Herring’s memo to Janet Rainey, director and state registrar of the Division of Vital Records, noting that “any statute requiring a governmental official to deny a marriage license to an applicant who declines to provide information about his or her race would raise serious constitutional questions.”

The Attorney General’s Office had asked Alston to dismiss the suit. It argued, among other things, that all the parties in the suit agree on the fundamental issue: No one should be compelled to label themselves racially as a condition of exercising their right to marry.

Alston found that the requirement violated the couples’ due process rights under the 14th Amendment.

The race question on Virginia’s marriage license application was taken out of the state code by the General Assembly in 2003 and was reinstated in 2005 for reasons that remain unclear. The chief patron of the 2005 bill died last year.

Only a handful of other states ask race information from people seeking marriage licenses.