BEIRUT, Lebanon — For the nearly four years Nizar Zakka was held prisoner in Iran, an ordeal that lasted until he was released this week, the knowledge that he was little more than a political pawn made a bad situation almost unbearable.

“It’s just trading of human beings — they just trade us,” Mr. Zakka, a Lebanese citizen who had lived in the United States for much of his life, and who arrived in Beirut from Tehran on Tuesday, said in an interview after his release. “Every evening, you feel like you want to leave this life. You are an innocent person. You never hurt anything.”

Mr. Zakka, an information technology professional, was held for about three years and nine months after being seized without warning in September 2015 on his way out of Iran, where he had been officially invited to attend a conference. Accused of being an American spy, he was sentenced to 10 years in prison and ordered to pay a fine of $4.2 million. Despite the apparent gravity of the charges, however, the Iranian authorities agreed a few weeks ago to turn him over to Lebanese officials, who had been formally asking Tehran for his freedom for months.

The timing — in the middle of a period of inflamed tensions between the United States and Iran that have led to fears of war — caused some to question whether Mr. Zakka was, once again, the object of geopolitical maneuvering. Though Iranian and Lebanese officials said his release was simply a matter of diplomacy and good relations between their two countries during the holy month of Ramadan, Mr. Zakka said he interpreted his freedom as a conciliatory signal from Iran toward the United States.