Brazil's former President Luiz Inácio Lula da Silva is set to walk out of prison after a judge ordered his release.
Federal police have to comply with Friday's order "with urgency," the decision said.
Hundreds of supporters gathered outside the federal police headquarters in the southern city of Curitiba where Lula has been held since April 2018 cheered after the order was issued.
It came hours after Lula's lawyers requested the immediate release of the 74-year-old leftist icon, who has been serving a nearly nine-year sentence for corruption and money laundering.
The move follows a Supreme Court decision Thursday that a person can be imprisoned only after all appeals to higher courts have been exhausted.
Da Silva is still appealing the case that put him behind bars, related to the alleged purchase of a beachfront apartment in Sao Paulo state.
The former leader, who governed from 2003 to 2010, had been favored to win the 2018 presidential election, but his conviction prohibited him from running.