File Photo: Former Iranian president Akbar Hashemi Rafsanjani s son, Mehdi Hashemi (C), is hugged by his brother Mohsen (L) in August 2015 before entering Tehran s Evin prison to serve his sentence for fraud. AFP
Mehdi Hashemi, 53, left Tehran's Evin prison late Tuesday, his lawyer Vahid Abolmaali said, quoted by the ISNA news agency.
State prosecutors said his release was "conditional", ISNA reported.
Hashemi was convicted of fraud, embezzlement and undermining national security in August 2015, charges he had previously denounced as "politically motivated".
He had served as a senior official in Iran's oil sector in the mid-2000s, a period when Norway's Statoil and French energy company Total were suspected of paying bribes to obtain access to the Islamic republic's hydrocarbon reserves.
In 2018, a Paris criminal court found Total guilty of "corruption of a foreign public agent" for payments made to Hashemi for help in securing rights to the huge South Pars offshore gas field which Iran shares with Qatar in the Gulf.
In 2009, Hashemi aroused the anger of conservatives by forming a "vote protection committee" for that year's presidential election.
He actively supported reformist candidate Mir Hossein Mousavi, whose allegations of large-scale fraud in favour of populist incumbent Mahmoud Ahmadinejad prompted mass protests.
Mehdi's father, Akbar Hashemi Rafsanjani, served as president from 1989 to 1997 and was regarded as a moderate who supported improving ties with the West.
Earlier this month, Rafsanjani's daughter Faezeh Hashemi was sentenced to five years in prison for "collusion against the security of the country".
She was arrested in September and convicted of inciting Tehran residents to join protests over the death in custody of Mahsa Amini, a 22-year-old Iranian Kurd, who had been arrested for allegedly violating Iran's strict dress code for women.