Iranian officials have insisted that the talks wait until after the presidential election, a senior administration official said, telling their American counterparts that they want to know which American president they would be negotiating with.

News of the agreement — a result of intense, secret exchanges between American and Iranian officials that date almost to the beginning of President Obama’s term — comes at a critical moment in the presidential contest, just two weeks before Election Day and a day before the final debate, which is to focus on national security and foreign policy.

It has the potential to help Mr. Obama make a case that he is nearing a diplomatic breakthrough in the decade-long effort by the world’s major powers to curb Tehran’s nuclear ambitions, but it could pose a risk if Iran is seen as using the prospect of the direct talks to buy time.

It is also far from clear that Mr. Obama’s opponent, Mitt Romney, would go through with the negotiation should he win election.