For the second time in a row, Britney Spears made it to the courthouse for a hearing in her ongoing child custody dispute -- only to again bolt at the last minute.

The pop star got to the court on time Wednesday but fled before a hearing that could have helped her restore visitation rights with her two young boys.

Wearing bright pink lipstick, sunglasses, shiny gold platform shoes and a very short black dress with a ruffled hem, Spears was driven into an underground garage and then entered the downtown civil court building.

A court spokesman said she got through a security metal detector, then announced, "I want to leave," and returned to her car.

Spears, 26, had not been ordered to be at the hearing.

On Jan. 14, the pop star also never made it inside the courthouse, leaving abruptly amid a swarm of paparazzi.

A lawyer for Spears' ex-husband Kevin Federline said Wednesday such behavior may have played a role in a Superior Court commissioner's decision that she would remain barred from seeing sons Sean Preston, 2, and Jayden James, 1.

"When you're trying to convince a judge that previous orders are not necessary, the court has to have the opportunity to observe, to hear from and to assess the demeanor of the person," attorney Mark Vincent Kaplan said outside court.

When Commissioner Scott Gordon called the Spears case on Wednesday, her attorney, Anne Kiley, went out of the courtroom to try to find her. Kiley returned 20 minutes later and conceded she didn't know if Spears would attend.

Gordon went ahead with the hearing after reporters were ordered to leave the courtroom. Spears' lawyer argued that she be allowed visits and Federline, 29, was asked a few questions, said court spokesman Allan Parachini.

"I can't provide any more details, except at the end of the day there was no change in the court order and Miss Spears has no visitation and no custody of the children," Parachini said.

Spears' attorney left without commenting to reporters. She did not return a call seeking comment.

Kaplan said the biggest questions in the custody case now have to do with the events of Jan. 3, when Spears refused to relinquish one of the children to a Federline bodyguard. Police were called and she wound up being hauled off to a hospital by paramedics.

The day after that incident, Gordon suspended Spears' visitation rights and gave full custody to Federline, who at that time had temporary custody.

"We know what happened that evening," Kaplan said. "But no one knows why it happened."

Late Wednesday, Spears' attorneys withdrew a pending motion that had asked the court to allow them to no longer represent her in the case.