Ministry Spokesman Abbas Mousavi thanked the Hostage Support Partnership group, U.N. officials in Somalia, and authorities in Somalia's semi-autonomous Puntland and in Ethiopia for their help in winning the release of Mohammad Sharif Panahandeh, the state news agency IRNA said.
Three Iranians sailors are still being held, Mousavi said.
"We are happy to announce we have obtained the release of one of the last hostages of Somali piracy ... 3 more seafarers remain who need our help," Hostage Support Partnership tweeted.
Earlier, Iranian media reports said Panahandeh was among 21 crew members of a boat hijacked in March 2015. Eight of the hostages died, five escaped, and four were freed in a security operation by Iran last year, the reports said.Piracy off Somalia’s coast has subsided in the past few years, mainly due to shipping firms hiring private security and the presence of international warships.