A court in French Polynesia has ordered the immediate release of the mayor of Mahina, Emile Vernaudon, who had been jailed for four months.
His release on bail comes after the court had rejected his plea to be set free four times.
Mr Vernaudon had been in prison since December as part of an investigation into alleged fraud and theft during his time as government minister.
Last month, he became the first jailed person under French jurisdiction to be elected mayor.
The Mahina council then installed him in office by placing a ribbon around his photograph in the mayor's chair.
Mr Vernaudon is a key member of the opposition To Tatou Aia coalition which is the local partner of France's ruling UMP Party.