Democratic gubernatorial candidate Krishanti Vignarajah, left, and her running mate, Sharon Blake, after a judge dismissed a request to disqualify Vignarajah. (Brian Witte/AP)

This story has been updated to provide more detail on the judge’s ruling.

An Anne Arundel Circuit Court judge affirmed Tuesday that Krishanti Vignarajah is eligible to run in Maryland’s Democratic gubernatorial primary, following a lawsuit by a Baltimore County man who sought to remove her name from the ballot.

Douglas Horn alleged that the time Vignarajah spent living and voting in the District should disqualify her because Maryland requires that its governor be a resident of the state for five years before the election.

Judge Alison L. Asti dismissed Horn’s request for declaratory judgment because it was “untimely,” according to a signed court order.

Maryland law requires that challenges to eligibility based on residency be filed within nine days of the filing deadline, which was Feb. 27.

Asti denied the request “in less than 30 minutes,” Vignarajah’s campaign said in a news release. The statement said that the court hearing “affirmed that Vignarajah has been a validly registered voter for the requisite period to be eligible to serve as Governor.” But the court order did not mention Vignarajah’s registration, only the timeliness of the lawsuit.

Vignarajah, who worked as a Washington lawyer and for the Obama administration, also was registered to vote in the District, and voted there from 2010 through 2014.

Although she registered to vote in Maryland in 2006, she voted there for the first time in the 2016 general election.She listed her residence as in the District on government documents as recently as May 2016.

Vignarajah, a former policy director for Michelle Obama, was the second candidate in the crowded gubernatorial primary to go to court on a ballot-related matter.

Valerie Ervin, who replaced the late Kevin Kamenetz at the top of the ticket after his unexpected death last month, tried to force the State Board of Elections to reprint the ballots to show her running for governor, not lieutenant governor.

A judge ruled that the state did not have the time to do so.

Late Tuesday, Ervin dropped out of the governor’s race and endorsed Prince George’s County Executive Rushern L. Baker III.

Early voting begins Thursday, and the primary is June 26.