Kofi Annan, the United Nations secretary-general, who is coming to the end of his time in office, has been carrying out what journalists like to call “a swing’ through the Middle East”. He has carried out an exhausting trip that included talks in Lebanon, Israel, Syria, Qatar, Saudi Arabia, Egypt, Turkey and Iran.

Following the 34-day conflict in Lebanon, and at the main expense of Lebanon, the timing was good, even though his visit to Tehran was criticized as Iran had ignored the Aug. 31 deadline, set by the 15-nation Security Council, to suspend its uranium enrichment program.

The world fears that the program may end up with Iran having nuclear warheads in its many long-range missiles. Iran claims it has no such intention.

Responding to those who suggested his two-day visit to Tehran was a mistake — and they included many Americans — Kofi Annan told Le Monde: “As secretary-general, if I refuse to speak to leaders because I don’t like what they have said, I can’t do my job.”

He is entirely correct.

The UN has 191 member states and, sadly but inevitably, some of them are in the hands of madmen, crooks and criminals.

The secretary-general has to make a point of dealing with the awkward squad because frequently they are the greatest threat to peace and world order, and not just the likeable, the moderate and the sensible leaders.

If one were on the secretary-general’s staff in New York it would not be difficult to work out the agenda for his talks with President Mahmoud Ahmadinejad of Iran.

As well as formal meetings with advisers present, the secretary-general had a 10-minute tête-à-tête with the president. (It would be fascinating if somebody could leak that meeting to us!)

Top of the list would be UN Resolution 1701 of Aug. 11 which states Hezbollah has to disarm.

The secretary-general told the press after his meeting with the president that his host “agrees with me that we should do everything to strengthen the territorial integrity of Lebanon, the independence of Lebanon and work together for the reconstruction of Lebanon.”

Kofi Annan’s spokesman, Ahmad Fawzi, an Egyptian whom I knew well when he ran the UN Office in London, said that Annan and Ahmadinejad did not speak directly about the UN arms embargo on Hezbollah.

Iran is known to have supplied them with missiles.

I find that a little surprising as the subject is crucial if there is to be a period of relative calm in Lebanon.

However, Manouchehr Mottaki, Iran’s foreign minister, said after a meeting on Sept. 2:

“Despite whatever objections we have to the Resolution (1701) you will have, Mr. secretary-general, our full cooperation.”

Is that the truth?

From now on Hezbollah is not going to receive even a rifle from Iran? I would doubt it: Too much is at stake for Iran and Hezbollah. For many years there has been a remarkable lack of joined-up government in Tehran.

For example, it has appeared that Iran’s intelligence agencies operate a different foreign policy to that of the Foreign Ministry.

There seems to have been no meeting of minds whatsoever on the nuclear standoff between New York and Tehran.

Wisely, Kofi Annan suggested Iran — which has few supporters at the UN on this subject — should come up with a confidence-building gesture.

The secretary-general told reporters:

“I have had very good discussions here, and I think it has helped me further understand the position of Iran, which I will be able to discuss with key governments and the Security Council members when I get back.”

Annan found time to raise the subject of an Iranian exhibition of cartoons about the holocaust. This had been put on in response to the Danish cartoons that mocked Islam.

He said: “I think that the tragedy of the holocaust is a sad and undeniable historical fact. So we should handle that and teach children what happened in World War II and ensure that it is never repeated.”

The Iranians drew attention to a conference in a few weeks that is due to examine the evidence supporting the Nazi genocide.

Apart from outraging Israelis and Jews worldwide, President Ahmadinejad’s attitude to the holocaust is seen as ludicrous in Britain, where there have been a number of historical and high standard TV programs on this subject giving all the evidence one might want.

Iran is going to be a big headache for the United Nations for many years to come. It has great strategic importance. It is powerful and it is also unstable.

I cannot rule out a possible attack on its nuclear facilities by the Americans in the last months of an unpopular and remarkably foolish Bush administration.