WASHINGTON (AP) — The District of Columbia's highest court has ruled that the city must elect an attorney general as soon as practically possible.

Wednesday's ruling by the D.C. Court of Appeals invalidates a law passed by the D.C. Council last year that postponed the city's first election for attorney general until 2018. The position is currently a mayoral appointment. City voters approved a 2010 ballot measure that called for residents to elect their top attorney starting this year.

A lower court sided with the council in a lawsuit challenging the postponement, but a three-judge Court of Appeals panel reversed that decision and said the election should be held this year or as soon as possible in 2015.

The Attorney General's office says it plans to appeal to the full court.