NEW DELHI, India -- The ousted prime minister of Pakistan, Nawaz Sharif, appeared in public Friday for the first time in five weeks and told a judge that he was not guilty of any wrongdoing.

Appearing haggard, Sharif, who reportedly complained that he had been kept in solitary confinement by the new military government, was taken into a courthouse in Karachi by a knot of heavily armed paramilitary troops. He had been taken through the streets in an armored personnel carrier as part of a long caravan.The occasion was a hearing in an anti-terrorist court, a site that he had introduced to administer speedy justice to criminals against the state.

The proceedings were brief, and Judge Rehmat Hussain Jafri returned Sharif to custody, giving prosecutors until next Friday to present official charges that would let a trial begin. According to a complaint filed last week, Sharif is accused of hijacking, kidnapping and conspiracy to murder for having ordered air-traffic controllers to bar the landing of a plane that was carrying the army chief of staff. Sharif could face the death penalty if convicted.

"I did not conspire in a hijacking," he was quoted as having said. "Hijacking is done at gunpoint. In this case, the whole democratic process has been hijacked."

Gen. Pervez Musharraf, the army chief who ousted Sharif and is has declared himself Pakistan's chief executive, pledged that the case would be tried in a "fair and transparent" way. But the press was denied access to the courtroom. Guards beat up some journalists, and others were threatened with weapons.

Sharif's statements in court were recounted after the hearing by his lawyers and others who had been inside. The lawyers had not been permitted to see their client beforehand.

"What is happening today, has the trial started?" Sharif asked, according to a lawyer.