MANILA, Philippines -- The Philippine Supreme Court on Tuesday dismissed a plunder charge against former President Gloria Macapagal Arroyo and ordered her freed immediately after nearly five years of hospital detention.

The justices voted 11-4 to grant Arroyo's petition seeking to dismiss the plunder case before the special anti-graft Sandiganbayan court because of a lack of evidence, Supreme Court spokesman Theodore Te said. The case involved the alleged misuse of 366 million pesos ($7.8 million) from the state lottery agency, the Philippine Charity Sweepstakes Office.

"I rejoice over this decision that has already given her what she rightly deserves which is justice," said Jesus Dureza, who had been Arroyo's adviser on peace talks with communist and Muslim rebels.

Dureza said he congratulated Arroyo in a phone call and heard many supporters in the background as she spoke. Dureza was reappointed as peace talks adviser under the current president, Rodrigo Duterte, who added a number of Arroyo allies to his Cabinet.

Arroyo, 69, finished her tumultuous nine-year term in 2010 but was arrested the following year on an election fraud charge, for which she was allowed to post bail. She was later charged with plunder.

Despite her detention and her neck ailment that prompted her to use a wheelchair, she was re-elected to Congress in May.

Arroyo was detained under former President Benigno Aquino III, who accused her of corruption and misrule. Aquino's successor, Duterte, however, has said the plunder case against her was weak and offered to grant her a pardon to allow her release.

Arroyo rejected his offer, saying she had to be convicted first of a crime to be eligible for a pardon, and that she preferred to fight the allegation.

A daughter of a former Philippine president and a classmate of former U.S. President Bill Clinton at Georgetown University, Arroyo had been a senator and vice-president before suddenly rising to the presidency in 2001 after then President Joseph Estrada was ousted in a "people power" revolt that she helped lead. Estrada was accused then of largescale corruption, which he denied.

She won the presidency in regular elections in 2004 but her presidency was rocked the following year by a series of corruption and vote-rigging scandals, including wiretapped conversations with an election official where some alleged she discussed ensuring her vote lead.

Arroyo admitted talking to an election official and apologized for her "lapse in judgment" in making such a call but said the conversation occurred after the votes had been counted.

Raul Lambino, one of Arroyo's lawyers, said the mood turned jubilant in Arroyo's hospital room when word leaked that the country's highest court was set to strike down the only criminal case keeping her detained. Arroyo was smiling in the picture he took with her.

Another Arroyo lawyer, Ferdinand Topacio, said the Supreme Court "has once again proven itself to be the final bastion of justice and the rule of law."

The ruling, he said, validated the position of the Arroyo camp that the charges against her were "nothing more than disingenuous attempts at political persecution."

"We are reminding the Supreme Court that the Arroyo government left behind 1,206 victims of political killings and 206 victims of enforced disappearances among activists, peasants, and human rights workers," said Cristina Palabay, secretary general of the human rights group Karapatan. She said the 2009 massacre of 58 people, including 32 journalists, in the world's worst single killing of media workers, also happened during Arroyo's term.

Karapatan said "while plunderers and murderers like Arroyo are set free from prison, more than 500 political prisoners remain in jail, many of them arrested during the Arroyo regime."