By Paul Reynolds
World affairs correspondent, BBC News website
The West will have to deal with the firebrand president for four more years
With Mahmoud Ahmadinejad continuing as president of Iran, continuing tension with international critics of its nuclear activities can be expected.
President Ahmadinejad's style is likely to ensure that confrontation will be the hallmark of his second term as it was his first.
The only hope, though certainly not the expectation, of calmer times perhaps is that, having won again, he might feel the time has come for compromise. He cannot run for another consecutive term, though he could stand again after a break.
(Update: this is of course assuming that the declared result will stick. If there is major unrest, he might be tempted to take a harder line than ever over the nuclear issue as a classic way of rallying support for his government.)
It is not that other governments had expected Iran to give up the enrichment of uranium if his opponent Mir Hossein Mousavi had won. Mr Mousavi too is in favour of enrichment and policy on this is ultimately set by the supreme leader Ayatollah Khamenei anyway, but a new president would have changed the tone of the debate and reduced tensions.
A compromise might have been possible.
There would, in addition, have been an end to Mahmoud Ahmadinejad's talk as president of questioning the Holocaust and wanting to see an end to the State of Israel.
Although his supporters argued that such talk about Israel meant the political end to the state and the emergence of a State of Palestine, Israelis interpreted it as threatening and, coupled with the development of enrichment technology, alarming.
There is now the prospect of more sanctions on Iran, and Israel in particular will express renewed concern, fearing that the Islamic Republic might one day build a nuclear weapon despite its denial that it intends to do so.
For the Israeli prime minister Benjamin Netanyahu, the Iranian intention is not the issue. The Iranian ability is. He does not want Iran even to gain the technology to make a nuclear weapon.
Iran says its intention is central. It says it will enrich only to the level needed for nuclear power and not to the higher level needed for a nuclear bomb. The UN agency the International Atomic Energy Agency continues to monitor Iranian nuclear facilities.
A key indicator will be the Iranian reply to an offer of talks from President Obama.
Western officials fear that even if he agrees, President Ahmadinejad might see any talks simply as a way of telling the United States to change its policy towards Iran and not as an opportunity to resolve differences.
Uranium enrichment is now so embedded in Iranian policy and psyche that it is hard to see President Ahmadinejad giving it up. It has become a totem pole of national dignity and self-respect and, for the Iranian president, a source of political power.
Iran has been offered a package of trade and financial incentives if it suspends the whole enrichment process but so far President Ahmadinejad and the supreme religious authorities have not taken this up. It remains on the table.
So the election has brought the issue no further toward resolution.