A judge has ordered Oakland City Council President Lynette Gibson McElhaney to turn over records to the city’s Public Ethics Commission for an investigation into whether she used her office for personal gain.

Alameda County Superior Court Judge Kimberly Colwell issued the ruling last week, giving McElhaney until Nov. 23 to produce the documents. McElhaney is fighting to keep her seat and was initially scheduled to appear in court on Monday, the day before election day.

The ethics commission sued McElhaney on Oct. 5, saying she repeatedly broke promises to submit documents it needed for an investigation it launched in February 2015. The probe stemmed from complaints that the councilwoman inappropriately influenced planning department decisions on a town-house development planned next door to her West Oakland home.

In June, a civil grand jury found that McElhaney had breached city and state ethics rules because she had a “material financial interest” in the project due to its proximity to her house and its effect on her privacy.

According to the grand jury report, the councilwoman contacted Oakland’s planning and building chief, Rachel Flynn, to make objections to the project. Flynn then pressured the developer to scale back the design, reducing the height and directing views away from McElhaney’s house. She also urged the developer to consider an alternative design by an architect with ties to McElhaney, the report said — even after the city’s planning commission had approved the project.

The councilwoman ultimately derailed the project, and the owner is now offering the lot for sale, the report said.

The ethics commission filed an administrative subpoena for documents related to the case on July 22. It said in its lawsuit that McElhaney missed its initial deadline on Aug. 10, and then blew subsequent deadlines on Aug. 26, Aug. 29, Sept. 1 and Sept. 2.

McElhaney could face a fine of $5,000, or up to three times any amount she might have paid to fight the project, if the commission finds wrongdoing.

The councilwoman said Monday that she had been waiting to hire an attorney before submitting the records and that she finally secured one last week.

“We’re going to fully cooperate with the ethics commission,” McElhaney said. “We’re looking forward to putting all of this behind us.”

Referring to the grand jury report, she said she had sought the advice of City Attorney Barbara Parker before approaching Flynn with concerns about the town-house project.

“I followed her (Parker’s) advice and believe we did everything in accordance with the rules,” McElhaney said.

Parker’s chief of staff, Alex Katz, said the city attorney can’t comment on advice to clients, or even say whether she gave advice on a specific issue. “But conflict-of-interest laws are pretty straightforward,” he said. “And anybody can look them up.”

The commission’s chief of enforcement, Milad Dalju, declined to comment, citing the pending litigation.

Rachel Swan is a San Francisco Chronicle staff writer. Email: rswan@sfchronicle.com Twitter: @rachelswan