A Pakistani court ruled on Thursday that it will indict former Prime Minister Imran Khan on charges of contempt of court, his lawyer and local broadcasters said, which could lead to his disqualification from politics if convicted.

The ruling has stoked more political instability in the South Asian nation of 220 million, which is facing the worst-ever flooding.

In such a contempt case, the accused are required to tender an unconditional apology without any justification, clearly stating that they leave themselves at the mercy of the court, legal analysts say, as long as the accused do not want to contest the case.

Khan did not give a clear apology.

"Now what?," he told reporters as he left the courtroom when asked about his response to the decision. "Now, they (the judges) have to decide," he said.

Former Prime Minister Yousaf Raza Gilani and several members of the parliament have in the past been convicted of contempt of court and been disqualified from contesting elections for five years.

Khan's aides have described his legal issues as an attempt to knock him out technically after seeing his growing popularity among people since his ouster in April in a confidence vote.

Since then, Khan has been holding political rallies mustering support and demanding fresh elections, which his successor Prime Minister Shehbaz Sharif and his coalition government have refused.

Khan whose Pakistan Tehreek-e-Insaf (PTI) party won elections in 2018 is accused of threatening a judge who ruled against one of his close aides facing treason charges.

"The court has decided to indict him," his lawyer Faisal Chaudhry told reporters. It is a decision by five member judges, he said.

"We will not spare you," Khan had said in a public rally last month, naming a female judge who declined bail to his aide, which analysts say could be an attempt on his part to put the judiciary under pressure in the run-up to the next elections due in Oct 2023.

The court will indict Khan at a hearing on Sept. 22, Chaudhry said.

Khan is also facing anti-terrorism charges in the same case of threatening the judge and Islamabad's police chief. He is on bail in that case.

The judges had given Khan several chances for him to reconsider an earlier response to the court where he expressed regret over the remarks rather than giving an outright apology.

The judges also warned Khan's lawyers repeatedly on Thursday, saying he did not understand the sensitivity of the matter, the broadcasters said.

Khan, who was brought to power with the military's support, had fallen out with the powerful generals in his final months in office.

Both Khan and the military, which analysts say mostly decide who will rule the South Asian nation, deny that.

The military earlier this week said in a rare direct rebuke, that it was "aghast" at Khan's comments about the upcoming appointment of an army chief.

Khan had said the ruling coalition will appoint a favourite as army chief because "they are afraid that if a strong, patriotic army chief comes, he will make them answerable (about their corruption).