ISLAMABAD - Former Pakistani Prime Minister Imran Khan on Thursday said sorry in a contempt of court case and promised not to hurt the dignity of the judiciary, the court said, a concession that could avoid his disqualification from politics.

The charges are related to a speech by Khan in which he allegedly threatened police and a female judge last month after one of his close aides was denied bail in a sedition case.

"He stated that he realized during the proceedings that he may have crossed a red line," the court said in a short order seen by Reuters. Kahn had previously denied being threatening.

The high court had been expected to indict Khan, a move that could have led to his exclusion from politics if convicted.

A convicted politician is liable to be disqualified for at least five years under Pakistani laws.

Local media present inside the courtroom quoted Khan, saying, "I'm sorry if I crossed any line."

He assured he would never do anything in future that would hurt the dignity of the court or the judiciary, and he would willingly apologise to the female judge if she felt it necessary, the court order said.

"We are, prima facie, satisfied," the order by a five-member court panel said, ordering Khan to submit an affidavit for consideration of the court before the next date of hearing, Oct 3.

The court deferred the decision on whether to indict Khan, said his lawyer, Faisal Chaudhry.

Chaudhry told Reuters he expected charges would now mostly be dropped.

"The court has appreciated the gesture," he said. "We will prepare and submit in writing an unconditional apology as sought by the court."

LEGAL WOES

The cricket-star turned politician has faced a barrage of legal woes since his ouster in a confidence vote in April by a united opposition led by his successor, Prime Minister Shehbaz Sharif.

Another of the critical cases against him is related to foreign funding for his Pakistan Tehreek-e-Insaf (PTI) party, which an inquiry by an election tribunal has found unlawful.

Analysts say Khan, who won election in 2018 with the backing of Pakistan's military, fell out of favour with the powerful generals in his last months in office.

Both Khan and military deny that version of events.

The former premier has led big rallies since his ouster, demanding snap polls, which the ruling coalition has rejected, saying elections will be held as scheduled later in 2023.

He has called supporters to an anti-government country-wide protest campaign starting Saturday that will culminate in a march on the capital Islamabad.

Islamabad police brought up the charges after Khan's public remarks that he would not spare the police and a judicial officer, who had denied bail to his aide.

Khan and his legal team subsequently said the remarks were not meant to be a threat, but that he would take legal action against the officers.

(Reporting by Asif Shahzad; Editing by Frank Jack Daniel and Toby Chopra)