A Lebanese businessman detained in Iran since 2015 for alleged anti-state activity left the country on Tuesday, a Lebanese official said, after Beirut secured his release.