A state appeals court on Tuesday stopped the county registrar from certifying results of San Diego's mayoral election, hours before the deadline.

California's 4th District Court of Appeal (search) in Santa Ana ruled in a lawsuit that seeks a new runoff election between the top two finishers in the primary — incumbent Dick Murphy (search) and San Diego County Supervisor Ron Roberts (search), both Republicans.

The court did not explain its decision and tentatively scheduled a hearing Friday.

The suit alleges that the city violated its own charter by allowing a write-in candidate — maverick Democratic councilwoman and surf-shop owner Donna Frye (search) — to run for mayor in the Nov. 2 general election.

The lawsuit, filed by San Diego attorney John Howard, may determine the outcome of the mayor's race. In November, Murphy received 34.5 percent of the vote, Frye got 34 percent and Roberts had 31 percent. The county registrar had planned to certify the results Tuesday, six days before the mayor takes office.

At issue is a provision of the city charter that says the general election should be a runoff of the top two finishers in the primary if no one wins a majority. Howard says the charter trumps the city's municipal code, which allows write-ins.

An attorney for the Murphy campaign, Bob Ottilie, played down the ruling.

"This is not a setback for Mayor Murphy, it's a delay," he said. "It would be fair to read this as a cautious approach by the court of appeal pending an opportunity to hear from the other side."

The move came just before a federal judge refused to halt certification of the election on similar grounds. In that lawsuit, three San Diego voters allege that the city's refusal to abide by its charter violated voters' constitutional rights.

At a hearing, attorneys for Murphy and the city said any objections to Frye's write-in bid should have been made before the election. They also argued that a new election would pose a heavy financial burden — $2 million for the city, plus campaigning costs for the candidates.

Rory Wicks, an attorney for Frye, also opposed a new runoff, saying the councilwoman "complied to the teeth" with election rules.

Her chief of staff, Steve Hadley, said Frye had no comment on the latest developments.