TEHRAN — Iran’s leaders, seizing on perceived flexibility in a private letter from President Obama, have decided to gamble on forging a swift agreement over their nuclear program with the goal of ending crippling sanctions, a prominent adviser to the Iranian leadership said Thursday.

The adviser, who participated in top-level discussions of the country’s diplomatic strategy, said that Mr. Obama’s letter, delivered to Iran’s new president, Hassan Rouhani, about three weeks ago, promised relief from sanctions if Tehran demonstrated a willingness to “cooperate with the international community, keep your commitments and remove ambiguities.” The text of the letter has not been made public, but the adviser described its contents in an interview in his office on Thursday.

A senior American official did not dispute the general outlines of the letter as described by the longtime adviser and Iranian political expert, Amir Mohebbian. But the official said Mr. Obama had not promised Iran quick relief from sanctions, and had steered clear of any detailed proposal.

Mr. Mohebbian and other officials and analysts said that Iran was focused on getting quick relief from financial sanctions because they have cut it off from the international banking system, and that in exchange it might be willing to curb its nuclear enrichment program. Some in the leadership are also worried that if nuclear talks do not yield quick results, Iran’s hard-line clerics and military men — currently sidelined — could attack Mr. Rouhani as a sellout and clip his political wings.