In a sharp reversal of course, D.C. residents could vote for an attorney general as soon as November after the District’s highest court ruled Wednesday that city lawmakers acted illegally in delaying the first such election.

The D.C. Court of Appeals ruling is a rebuke to the D.C. Council members who voted 7 to 6 last year to push back the debut election of the city’s top legal officer until at least 2018.

It was the council that first moved to put the office on the ballot, through a charter amendment that won overwhelming support from voters in a 2010 referendum. But last July, a majority of council members, citing a lack of candidates and uncertainly about the powers of the elected office, moved to delay the election, despite the 2010 ballot proposal’s having indicated that it would take place this year.

Irvin B. Nathan, the District’s current, appointed attorney general, held last year that because the underlying language of the charter amendment provided for an election “after Jan. 1, 2014,” the council was within its rights to impose a delay. Nathan’s deputies later argued that point in court.

But a three-judge panel disagreed, declaring in a five-page order that “a far more natural reading of ‘shall be after January 1, 2014’ is that an election . . . must be held in 2014.”

The judges ordered that the election must be held this year, perhaps during the Nov. 4 general election, unless officials can establish that it is not practical to do so. If not this year, the judges said, “then the election must be held as soon thereafter in 2015 as is practically possible.”

The court decision comes after eight months of litigation begun by Paul H. Zukerberg, a criminal defense lawyer who sought an at-large council seat last year and later declared his candidacy for attorney general. Zukerberg argued that, based on the explicit ballot language and the ambiguity of the charter language, the delay was illegal.

A D.C. Superior Court judge in February rejected Zukerberg’s arguments and declined to order the attorney general’s office onto the April 1 primary ballot. But Zukerberg pressed on with an appeal, and during oral arguments last month, two of the appeals court judges expressed sympathy with his case, presaging Wednesday’s ruling.

Zukerberg hailed the court’s decision.

“There were some pretty dark moments in this litigation, but we pulled it out in the fourth quarter,” he said. “The court did exactly what they needed to do.”

The three judges — Corinne Beckwith, Catharine Friend Easterly and Roy W. McLeese III — moved Wednesday to send the case back to Superior Court to determine how soon the election for attorney general can reasonably be held. But they may not have the final word on the matter.

In a statement after the ruling, Nathan said his office will seek an “en banc” review of the case, putting the question before all eight active Court of Appeals judges.

Such requests are infrequently granted. Under the court’s rules, a rehearing can be ordered only if a panel decision conflicts with another of the court’s decisions or if it “involves one or more questions of exceptional importance.”

The key issue Wednesday involved the extent of the D.C. Council’s power to overrule a charter amendment. The appellate panel, drawing on the legislative history of the amendment, held that the “after Jan. 1, 2014” reference could not be interpreted as inviting indefinite delays.

That holding is at odds with Nathan’s advice to the council before its vote to delay the election. Nathan said the council was within its rights to legislate a delay. The council’s own attorneys had previously advised that a delay would be illegal.

The move for further review vexed supporters of electing the attorney general, including Council Chairman Phil Mendelson (D), who orchestrated the charter amendment and called the delay an “embarrassment” last year.

“My sense is that a majority of council members would prefer this was over,” he said Wednesday. “This has been litigated and litigated, and let’s move on. I don’t think it’s in the interest of the voters to continue to delay this election.”

A spokesman for Mayor Vincent C. Gray (D), who supported the charter amendment as council chairman and opposed the delay as mayor, said Gray continues to support holding an election this year. But Pedro Ribeiro, the spokesman, said Gray could not order Nathan to give up the appeal because the mayor is not a party to the case.

The appeals court panel said in its order that “time is of the essence” if the election is to be scheduled for November, and the petition for rehearing could make it impractical to move forward on that schedule. Ballot petitions, for instance, will be made available to candidates for other offices June 13 for an eight-week circulation period.

There is another complication: a lack of candidates. Before the council delayed the election, no one had emerged to seek the office, which contributed to the decision to delay. Only Zukerberg has stepped forward since.

Walter Smith, executive director of the D.C. Appleseed Center for Law and Justice, which advocated an elected attorney general and opposed the delay, said he expects qualified candidates to come forward in short order.

“I think there have been candidates all along who have been interested but who have not stepped forward because there was such uncertainty about whether or not there was going to be an election,” Smith said. “Before people made up their mind, this whole pall was cast over it.”

Zukerberg, who is best known for defending clients accused of marijuana offenses, said he will remain a candidate. He previously collected enough petitions to appear on the Democratic primary ballot before the Superior Court judge ruled against his request to overturn the delay.

“They just have to tell me where the starting line is and where to show up,” he said. “If they want to make me circulate petitions again, if that’s what it would take, hand me that clipboard.”