Avoiding a federal takeover, the Oakland, Calif., police department Wednesday became the first U.S. city to willfully surrender authority over its command staff to a court-appointed director. The agreement came a week before a scheduled hearing before a federal judge over the department’s failure to comply with a decade-old reform plan that settled an infamous police brutality scandal, according to the Oakland Tribune.

The agreement to appoint a federal compliance director must still be approved by U.S. District Court Judge Thelton Henderson. The judge had scheduled a hearing for Dec. 13 to consider possibly stricter oversight, including a federal takeover of the police department.

The compliance director will not displace Oakland’s police commanders, but will have broad power to push through reforms to end racial profiling and brutality. The federal officer can overrule the police chief on major decisions, demote the command staff and order expenditures of up to $250,000. The compliance director can also fire the police chief, subject to appeal to Henderson.

The latest agreement rose out of a 2003 settlement in an $11 million civil case involving four Oakland police officers accused of beating up and framing drug suspects, and then writing false reports to hide it. The city agreed to make 51 reforms but continually failed to make improvements such as tracking problem officers and reporting on the use of force. Lawsuits involving the police department have cost the city about $46 million over the last decade.

Oakland Mayor Jean Quan welcomed the new agreement. “This is something we want for Oakland,” she said, according to the Tribune. “We have a stake in making this work.” The city council is considering a plan to beef up funding and staff for the police department by next spring.