The Philippine Supreme Court has acquitted former President Gloria Macapagal Arroyo of plunder, and ordered her immediate release.
Ms Arroyo has spent nearly five years in hospital detention accused of misusing 366m pesos ($7.8m; £6m) of lottery funds intended for charities.
Supreme Court spokesman Theodore Te told reporters the case was dismissed "for insufficiency of evidence".
Despite her detention, Ms Arroyo, 69, was re-elected to Congress in May.
Ms Arroyo was initially arrested in late 2011 after nine years as president, on accusations of electoral fraud, but was released on bail.
A few months later she was charged with corruption and arrested again.
She has since been held in a hospital because of a neck and back complaint which requires her to use a wheelchair.
Newly elected President Rodrigo Duterte had said the case against Ms Arroyo was weak and offered her a pardon, which she rejected, saying she preferred to fight the accusation.
Several Arroyo allies have been appointed to Mr Duterte's cabinet, including advisers on national security and on peace talks with rebel groups.