Leila de Lima, 64, faced various charges in 2017 within months of launching a Senate inquiry into Duterte's brutal anti-narcotics campaign, in which thousands of users and dealers were killed by police or in mysterious circumstances.
"Free at last," De Lima told reporters and supporters at a press conference shortly after her release from prison.
Duterte, whose term ended in 2022, accused her of colluding with drug gangs while she was justice minister, which led to charges of conspiracy to trade narcotics.
Two of three cases against De Lima have since been dismissed and she had sought bail in the one pending case on health grounds, which the court granted on Monday.
Salvador Panelo, former presidential legal counsel to Duterte, said government prosecutors can appeal the bail to higher courts. They could also introduce further evidence "to make a case for conviction", he said in a statement.
De Lima has always insisted the charges against her were baseless and politically motivated.