Pakistan's powerful military said Wednesday that ailing former army chief Pervez Musharraf, who seized power in a bloodless coup 23 years ago and ruled for nine years, should be allowed to return from self-imposed exile in Dubai.

Musharraf's family said last week the 78-year-old was unlikely to recover from multiple organ failure in Dubai, where he has been since 2016 after being allowed to leave Pakistan for medical treatment.

At the time, the former four-star general was facing multiple court cases related to his period of rule, and was sentenced in absentia to death for treason, a ruling that was later annulled.

"It was the opinion of the institution and its leadership that Pervez Musharraf may return to the country in view of his poor health if the family so desires," Major General Babar Iftikhar, head of the military's Inter Services Public Relations (ISPR) publicity wing, was quoted as saying by local media.

ISPR confirmed his remark to AFP on Wednesday.

Musharraf still faces numerous court cases should he return to the country.

The military has ruled Pakistan for decades at various times since the country gained independence in 1947, and Musharraf was army chief of staff when he seized power after then-prime minister Nawaz Sharif tried to sack him in 1999.

His legacy is a controversial one, with some crediting him with rescuing Pakistan from economic crisis and others blaming him for fanning extremism by allying the country with the United States in its war against armed groups in the wake of the 9/11 attacks.

While in office, he oversaw a stint of economic growth while surviving at least three assassination attempts.

But he is also accused of overseeing a period marked by human rights abuses and the disappearance of hundreds of activists.

Leading human rights activist Tahira Abdullah said Musharraf should be tried if he does return.

"As a citizen of Pakistan, everyone has the right of return," she said.

Former Pakistani military ruler Pervez Musharraf was popular in the West for supporting then-US President George Bush's war on armed groups in the wake of the 9/11 attacks
Former Pakistani military ruler Pervez Musharraf was popular in the West for supporting then-US President George Bush's war on armed groups in the wake of the 9/11 attacks AFP / TIM SLOAN

"However... he must be arrested immediately after setting foot on Pakistani soil and must be sent to jail -- or to hospital if he is ill", she added.

Musharraf's easygoing charm failed to mask the blurring of the division between the government and army, and his popularity plummeted after trying to sack the Supreme Court chief justice and declaring a state of emergency in late 2007.

After the assassination of opposition leader Benazir Bhutto, the national mood soured even more and crushing losses suffered by his allies in the 2008 elections left him isolated.

Musharraf's plan to return to power in the 2013 general election was dashed when he was disqualified from running in a poll won by Sharif -- the man he deposed in 1999.

On Tuesday, Sharif -- whose brother Shehbaz is now prime minister -- said he supported allowing Musharraf to return.

"I have no personal enmity with Pervez Musharraf and do not want others to undergo an agony that I experienced about my loved ones," he tweeted from London, where he lives in self-imposed exile after being convicted on corruption charges in 2018.

"I pray to Allah the almighty for his health. The government should facilitate him if he wants to come back", Sharif added.

Retired general Talat Masood, now a defence and political analyst, said Musharraf should be allowed to die in peace at home.

"After all, he is a Pakistani... and now wants to spend his last days in the country and he should be allowed", he said.

Liaqat Baloch, a senior leader of the Jamaat-e-Islami party, also said Musharraf should be allowed to return.

"We pray to Allah that he recovers soon -- and then he should face the raft of cases pending against him," he said.