BBC News, Tehran
One moment, US President George W Bush was warning of the danger of World War III because of Iran's nuclear programme.
Iran's president appears to revel in the spotlight
In the next, peace was breaking out. It's been a strange year for Iran.
For much of the year the pressure was building inexorably, as Iran refused to compromise over its programme to enrich uranium - a programme the West fears could be used to produce a nuclear bomb.
New sanctions looked inevitable and war was beginning to look like a possibility.
All that changed overnight with the release early in December of a new intelligence assessment in Washington which declared that Iran was not, after all, trying to build a bomb.
"It is quite amazing for you to wake up in the morning, and then all the accusations that have been stated against your country day and night, suddenly they have been withdrawn," said Saeed Mohamed Marandi, head of North American Studies at the University of Tehran.
President Ahmadinejad has not been far from controversy of late
President Mahmoud Ahmadinejad was in particularly good humour when he met the media a few days after the report was released.
When one reporter asked whether there was a danger of war, the president almost laughed it off.
"What do you think?" he asked the reporter.
"Personally I don't believe it," replied the reporter.
"Well, I agree," the president joked.
Indeed, most observers believe this new intelligence assessment makes war almost impossible, even though Iran is continuing to develop centrifuges to enrich uranium.
Mr Ahmadinejad immediately declared it a great victory for Iran. But politically, it is a double-edged sword for the president.
His government faces crucial parliamentary elections in March and his critics have come out in force.
Hassan Rowhani, a former nuclear negotiator who may head the anti-Ahmadinejad list for parliament, witheringly declared that the president's foreign policy was little more than "letter-writing and slogans".
He said Iran's power in the world had been reduced by financial sanctions, not increased as the president likes to claim.
The former president Mohammad Khatami attacked the government's programme of "economic justice" and also hinted at support for university students who have been imprisoned by the authorities for leading protests.
Without the threat of war, Mr Ahmadinejad's strategy of calling all opponents "traitors" does not quite have the same force.
'Mayhem at the pumps'
Even the head of the Central Bank has criticised the way the government underestimates the spiralling rate of inflation, which most people believe has now risen to at least 25%.
Iranians have been hit by rising inflation in 2007
There are certainly plenty of critics of the president's economic policies.
"Now Iran is the only country in the world [where] the interest it is paying is higher than the interest it is receiving. So, this never happened in the world," said Hussein Abdoh, former head of the Tehran stock exchange.
"In my opinion that policy is taking from the poor and giving it to the rich."
In June, there was mayhem at the pumps after the government introduced petrol rationing.
This, in the country with the world's largest combined reserves of oil and gas.
So Mr Ahmadinejad is paying the price for his own mismanagement, sanctions on the oil industry, the banking sector and years of neglect of the economy.
But don't count him out quite yet.
Crisis or controversy
Earlier in the year I visited the annual Saffron festival in eastern Iran.
The release of captured marines and sailors had an air of absurdity
They grow more than 90% of the world's saffron here.
The president has increased saffron prices and pumped money into the villages.
Local people who are enjoying having telephones and running water for the first time still like him, and his brand of religious conservatism has plenty of supporters outside Tehran.
The president himself obviously loves being on the world stage, ideally in crisis or controversy. And he has had plenty of both during 2007.
There was the capture of 15 British sailors and marines in March in the northern Gulf between Iraqi and Iranian waters.
The episode ended with an air of absurdity, after the 14 servicemen and one woman were released, flying to freedom in new suits complete with goodie bags that were "gifts" from the Iranian people.
Even stranger was the president's declaration, during his appearance at Columbia University in New York, that Iran didn't have gays like they did in the United States.
And the president had to sit through a remarkable attack by the head of the university, Lee Bollinger.
"We at this university do not shy to challenge the failures of our own government, and we won't be shy about criticising yours," declared Mr Bollinger. "You exhibit all the signs of a petty and cruel dictator."
Surprises in store
But during his speech to the UN General Assembly, Mr Ahmadinejad was able to expand on a theme that has won him much support in the Arab, Muslim and developing world.
He aspires for himself and Iran to be a leader of anti-Americanism in the world and an opponent, for want of a better word, of globalisation.
It is a stand which has helped put pro-western governments in the Middle East under increased pressure.
Mr Ahmadinejad is enjoying his reputation as champion of the world's underdogs.
Will there be more surprises in 2008?
Could Mr Ahmadinejad be the man to lead a reconciliation with the United States some three decades after the Islamic revolution?
It certainly seems unlikely. But then Iran has shown in 2007 that it's a country that never fails to surprise.