ISLAMABAD (AP) — Pakistan’s former prime minister Nawaz Sharif, his daughter and son-in-law were released from prison Wednesday after a court suspended their sentences and granted them bail pending their appeals hearings.

The Islamabad High Court made the decision after the Sharifs petitioned to appeal their sentences, which were handed down by an anti-graft tribunal earlier this year in a corruption case against them. The three were released from a prison in the garrison city of Rawalpindi.

The development is the latest twist in a series of scandals involving the former prime minister, beginning with his ouster from office last year, to several corruption cases and trials he still faces.

When the anti-graft tribunal first convicted and sentenced Sharif on July 6, he was in London with his daughter, visiting his critically ill wife. The father and daughter returned home a week later and were taken to prison to serve their sentences.

Sharif’s party, the Pakistan Muslim League, meanwhile, lost in parliamentary elections later in July and has now taken on the mantle of opposition party to new Prime Minister Imran Khan’s government.

In Wednesday’s decision, the two-judge panel headed by Justice Athar Minallah ordered that Sharif, his daughter Maryam Nawaz and son-in-law Mohammad Safdar, be released once they each post a bond of half a million rupees, or about $4,000.

In the evening, the three were released from the prison, where many party leaders and a large crowd of supporters gathered to receive them, said Sen. Mushahidullah Khan, a close aide to Sharif. Khan said Sharif and relatives were escorted to the airport amid tight security. From there, they were to fly to the eastern city of Lahore.

Khan said Sharif and his daughter mourned the loss of Kulsoom Nawaz, Sharif’s wife who died after a long battle with cancer while they were in prison.

“I thought I would go straight to mother but she is no more,” Khan quoted Nawaz as saying.

Television footage showed a security vehicle driving the Sharifs through a massive crowd of supporters, some showering rose petals on the vehicle while others waved party flags and chanted slogans. Later, they arrived at the family’s estate in the Lahore suburbs to a warm reception by supporters.

Sharif was temporarily released earlier this month to attend his wife’s funeral.

Prosecutors in the case, the National Accountability Bureau, said they would appeal Wednesday’s ruling and take the case against Sharif to the country’s Supreme Court.

Following the judges’ decision on Sharif and his family, supporters rushed to the court in jubilation, chanting pro-Sharif slogans and waving banners and posters of the ex-premier.

“This is a triumph of justice,” said Sharif ally and former foreign minister Khawaja Asif outside the court.

Another supporter in the crowd, Naveed Abbasi, said he is convinced Sharif was a victim of conspiracy but that, “God willing, the people will make Nawaz Sharif the prime minister again ... for a record fourth time.”

Amjad Pervez, a defense lawyer, had said the required bonds had been posted and Sharif, his daughter and son-in-law would be released from Adiala prison, where they have been serving 10-year, seven-year and one-year prison sentences, respectively.

In July last year the Pakistani Supreme Court disqualified Sharif from office over corruption allegations. He faced several court cases at home and was later convicted of concealing assets abroad. The charges stemmed from leaked papers from a Panama law firm. Sharif faced two more cases before the anti-graft tribunal and has been banned for life from public office.

Reacting to Wednesday’s decision, Sen. Javed Faisal, a close aide to Prime Minister Khan, pointed out that the court only suspended Sharif’s sentence and those of his family members, and did not acquit them.

“Their supporters should not celebrate so much as they will likely have to go again to Adiala prison,” Faisal said.

However, analysts saw the decision as a definite boost for Sharif’s party and supporters.

“If the court finally quashes Sharif’s conviction, that will be a cause of concern for the new government,” said Tauseef Ahmed, adding that “Sharif is still a popular leader and has the capability to mobilize masses.”

Ahsan Iqbal, Sharif party lawmaker and former interior minister, said the anti-graft tribunal had convicted Sharif, his daughter and son in-law without any legal grounds, but “based on a vendetta.”

Sharif never completed any of his three terms as prime minister. His first government was dismissed by the then-President Ghulam Ishaq Khan in 1993 on corruption charges and his second government was toppled by Gen. Pervez Musharraf in a bloodless coup in October 1999.