President Mahmoud Ahmadinejad of Iran stoked the anger of Israel, the United States, Syrian insurgents and gay rights advocates on Monday, using the first full day of his final visit to the United Nations as Iran’s leader to assert that he has no fear of an Israeli attack on his country’s nuclear facilities, regards the Israelis as fleeting aberrations in Middle East history, is neutral in the Syria conflict and considers homosexuality an ugly crime.

In a series of public appearances that included a breakfast meeting with selected members of the news media, a speech on the rule of law at a United Nations conference and a CNN interview broadcast on Monday evening, Mr. Ahmadinejad sought to portray Iran as a principled and upstanding member of the global community.

But the Iranian leader, known for his denials of the Holocaust and other inflammatory statements, ignored a warning by the secretary general of the United Nations, Ban Ki-moon, against making provocative declarations. Instead, he offended a wide range of parties and prompted the Israeli delegation to walk out of the United Nations conference in protest.