By Jon Leyne
BBC News, Tehran
A year before President Mahmoud Ahmadinejad stands for re-election in Iran, he is facing a major new challenge. His former chief nuclear negotiator, Ali Larijani, has been voted speaker of parliament.
Mr Larijani accused the UN nuclear watchdog of "deception"
In effect, Mr Larijani becomes the leader of the opposition, in a strong position to stand against Mr Ahmadinejad in the elections. It also comes at a time of growing discontent over Mr Ahmadinejad's eccentric handling of the Iranian economy.
Mr Larijani is a fellow conservative. But he is seen as more of a pragmatist than the president.
Mr Larijani is the man who helped end the crisis over the captured British sailors in 2007.
Last autumn, he lost his job as chief nuclear negotiator because of what was seen as this more pragmatic approach. He was replaced by the hardline deputy Foreign Minister Saeed Jalili.
Ironic then, that Mr Larijani marked his election as speaker with an uncompromising speech, bitterly critical of the UN nuclear watchdog, the International Atomic Energy Authority (IAEA).
Mr Ahmadinejad said Western economic models had brought "famine"
He accused the agency of "deception". And he said the Iranian parliament might put limits on Tehran's co-operation with the nuclear agency if it was not given a fairer hearing.
His comments drew chants of "God is great" and "Death to America" from members of parliament.
It was an attempt to establish himself as an important figure in Iranian policy-making. At the same time he took a starkly different tone from the president, speaking in eloquent, almost academic Farsi, by contrast with the populist language of Mr Ahmadinejad.
But as this extended presidential election campaign begins, it is clear the major battle will be over domestic policy, in particular the economy.
Blaming the West
Iran's economy is in a mess.
Despite record oil revenues, inflation is heading close to 30% a year, and there is high unemployment.
President Ahmadinejad's unorthodox response has been to lower interest rates. Even now he is trying to get them down to single figures. He is also pressing for all the state banks to be merged in one giant corporation, run on Islamic lines.
In a speech to the Iranian parliament on Tuesday, he blamed Western economic models for many of the world's problems
"Their product is famine, disorder and an unprecedented economic recession," he said.
Instead, he argued, "we must seek our own theories, we must believe in ourselves".
But those low interest rates, rather than helping the poor, have stoked a property bubble that has only made their life harder.
In contrast to this outspoken, inventive approach, Mr Larijani has a reputation for quiet competence that will be increasingly attractive as the economy worsens.
As so often in Iran, there is another hand at work behind the scenes: the Supreme Leader, Ayatollah Ali Khamenei - the most powerful man in the country.
Ayatollah Khamenei is keeping his options open for now
He has always favoured the old tactic of divide and rule.
In the past it was reformists versus conservatives. But the power of the reformists has all but collapsed.
So now Ayatollah Khamenei has given the blessing for his loyal ally Mr Larijani to assume more power as a counterweight to President Ahmadinejad.
It does not mean that the supreme leader is about to withdraw his support for the president. Ideologically the two still seem particularly close, and Ayatollah Khamenei gave unprecedented support to Mr Ahmadinejad during the recent parliamentary elections.
No, the supreme leader is keeping his options open, keeping his supporters on their toes.
Which way he finally decides to jump could be critical in deciding whether President Ahmadinejad, or Mr Larijani, win the presidential elections next April.