An Iranian-American game developer has been released from Iranian custody after more than four years of imprisonment.

As reported by Ars Technica, 32-year-old Iranian-American game developer Amir Mizra Hekmati was released by Iran as part of a prisoner exchange between that country and the US.

Hekmati was accused by Iran of high-level espionage for the US government, and was supposedly working with the CIA to release games with the aim of manipulating public opinion in the Middle East.

“The goal of [my company] was to convince the people of Iran and the people of the entire world that whatever the US does in other countries is a good measure," he said in his confession.

War game developer released by Iran after four years' prison
Amir Mizra Hekmati.

He was sentenced to death, but that was overturned in a higher court, and he was then sentenced to 10 years in prison.

The US State Department called the charges against Hekmati "categorically false", and said Amir was just in Iran to visit his grandmother.

A former US Marine sergeant, Hekmati did contract work developing Department of Defense training programs before starting Kuma, a developer that according to its website makes "playable recreations of real events in modern combat".

Kuma\War goes beyond the battlefield with a vast database of intelligence and background info to supplement each mission,” reads one game’s description.

“From satellite photos, to political context as well as info about the weaponry, tactics and forces involved, you’ll be sure to get the most out of each and every operation.”

In 2012, two Bohemia Interactive employees holidaying in Lemnos, Greece, were arrested for taking photographs and film of military installations, and held in jail for several months on suspicion of espionage.

They claimed their footage was to be used in the then-in-development ARMA 3. The pair were eventually released on bail after spending 129 days in jail.