Maryland’s top court agreed Friday to resolve a dispute over whether former state Sen. Nathaniel Oaks should remain on the Democratic primary ballot after pleading guilty to corruption charges, the Attorney General’s Office said Friday.

On Thursday, an Anne Arundel County judge ordered the State Board of Elections to strike Oaks’ name from the ballot papers. The state agency quickly filed an appeal, saying the order threatened to disrupt preparations for statewide elections.

The Democratic and Republican primary elections are June 26, but early voting begins June 14.

The Maryland Court of Appeals set a hearing on the case for Wednesday, the attorney general’s office said, and allowed the state to continue preparing for the election in the meantime.

Oaks pleaded guilty to federal felony charges in March — too late to voluntarily withdraw from the election. Because his sentencing is not scheduled until after the primary election, he remained eligible to seek office.

On Monday, Oaks gave up his voter registration, meaning he no longer met the qualifications to run for office, and the Anne Arundel circuit judge issued his order.

Judge Glenn L. Klavans ruled that Oaks, a 71-year-old Democrat who has served in state office for nearly four decades, was no longer eligible to run after giving up his right to vote. Klavans said the elections board still had time to change the ballots before the primary and that keeping Oaks’ name on them would be confusing to voters.

“The harm to the voters by way of potential confusion, inadvertence, and/or mischief by the appearance of a disqualified name on the ballot far outweighs any inconvenience to the Board of Elections,” Klavans wrote.

Within hours of Klavans’ ruling Thursday, the Maryland attorney general’s office, representing state elections officials, filed its appeal to the state’s top court, arguing that changing the ballot in a single Baltimore district could be too disruptive this close to the primary.

The elections board asked the Court of Appeals to put Klavans’ ruling on hold while the case is under review, saying that if the appeals court doesn’t issue a stay, officials will have to stop printing ballots entirely.

Oaks has said that even if he were to win the primary election he would decline to accept the Democratic nomination. Former Del. Jill P. Carter, who heads the mayor’s civil rights office, and J.D. Merrill, a former teacher who is the son-in-law of former Gov. Martin O’Malley, also are running for the seat.

iduncan@baltsun.com

twitter.com/iduncan