Mr. Trump’s first instinct was to make the session all about Iran, listing his demands for what that country must do to negotiate a new nuclear deal, and threatening allies — including Britain, France and Germany, which negotiated the 2015 accord that Mr. Trump has disavowed — with harsh sanctions if they do not cut off all commercial ties with Tehran by November.

The British and the Germans, in particular, objected: An Iran-only session, they warned the White House, would starkly illustrate the split in the Western alliance that Mr. Trump set in motion by leaving a deal that the Europeans believe is preventing Iran from producing nuclear fuel for weapons. The European Union, in fact, has been threatening to penalize companies that obey Washington’s mandates about cutting off Iran.

At first, their complaints fell on deaf ears, according to a senior European diplomat. But then the White House had a change of heart, led mainly by Mr. Trump’s national security adviser, John R. Bolton. As a former ambassador to the United Nations, Mr. Bolton recognized that if Iran were the topic of the meeting, Mr. Rouhani would be entitled to a seat at the table to respond.

The result was a decision to broaden the agenda to countering the proliferation of nuclear, chemical and biological weapons, rather than simply countering Iran. While it is not clear that White House officials realized it, that was also the focus of the first Security Council meeting led by President Barack Obama, in 2009.

On Friday, however, Mr. Trump confused matters further by saying in a tweet, “I will Chair the United Nations Security Council meeting on Iran next week!”

That prompted queries from the Europeans, who thought the issue was settled. The senior diplomat said White House officials could not explain Mr. Trump’s tweet, but urged them to ignore it, assuring them that the agenda for the meeting would be followed.

Mr. Rouhani, for his part, is planning to use his time in New York to strike back at the United States and widen the divisions that Mr. Trump created when he pulled out of the agreement. On Sunday, he suggested that the United States bore responsibility for an attack on a military parade in Iran that killed 25 people and wounded nearly 70 others on Saturday.