French Polynesias veteran politician, Gaston Flosse, has been released from Tahitis Nuutania jail where he has been held since last month as part of a probe into alleged corruption.
His lawyers have succeeded in winning his freedom after a bid earlier this month had failed.
Over the next few weeks, Mr Flosse is to pay bail of nearly one million US dollars.
Restrictions on who he is allowed to meet have also been eased which means that he can again meet fellow party politicians and resume his work as assembly member and French senator.
Last month, he was freed for a week and his party then tried unsuccessfully to give him a senior government position.
When he was the territory's president, Mr Flosse received payments from a French advertising executive allegedly for giving him public sector contracts.