A court in Pakistan has allowed ailing former prime minister Nawaz Sharif to travel abroad for four weeks for medical treatment.

Sharif, 69, was given a seven-year jail term by an anti-graft court in 2018 for corruption and money laundering. But doctors say his health has deteriorated because he is suffering from multiple medical complications.

The high court in the city of Lahore ordered the government on Saturday to remove Sharif’s name from a so-called “exit control list” or ECL that bars people or convicts from leaving the country.

The ruling gives Sharif four weeks to seek medical treatment abroad and the duration can be extended further on doctor recommendations.

The former prime minister was released on bail last month on medical grounds but his lawyers argued his ailment required him to consult his regular doctors based in London. Sharif’s travel plans were not known.

The Pakistani government had asked Sharif to deposit financial guaranties in the form of an “indemnity bond” to ensure he comes back home after receiving treatment and serve his prison term in addition to facing several other ongoing cases of corruption against him.

But Sharif’s opposition Pakistan Muslim League-N party refused to submit the indemnity bond and instead approached the court against the government’s one-time conditional permission to travel abroad and succeeded in getting the judicial relief for its leader.

The government of Prime Minister Imran Khan had maintained it wanted assurances from Sharif because five members of his family, including two sons, previously left Pakistan and have not returned to appear in courts in corruption cases against them.  The Sharif family rejects the corruption charges as politically motivated.

Sharif was forced by the Supreme Court in 2017 to step down from the office of the prime minister for not declaring his overseas assets in his election nomination papers.