Iran's president has fired Foreign Minister Manouchehr Mottaki in part of a perceived power struggle in Tehran.
Initial reports gave no reason for Mahmoud Ahmadinejad's decision.
There had been no indication that Mr Mottaki - who was sacked while on an official tour of Africa - was about to lose his job.
Mr Ahmadinejad has appointed the country's top nuclear official, Ali Akbar Salehi, to replace Mr Mottaki in a caretaker capacity.
"I appreciate your diligence and services as the foreign minister," said Mr Ahmadinejad in a letter to Mr Mottaki, Mehr news agency reported.
Mr Mottaki was appointed foreign minister in 2005.
Analysts say Mr Mottaki's dismissal may be part of a political power play among ruling conservatives in Iran.
There has been mutual distrust between the president and Mr Mottaki since the 2005 election that brought Mr Ahmadinejad to power: Mr Mottaki was the campaign manager for one of Mr Ahmadinejad's rivals, Ali Larijani.
Mr Mottaki and Mr Larijani are often described as part of a pragmatic conservative bloc that believes the president's inflammatory speeches and radical agenda have made Iran more vulnerable.
Relations worsened when Mr Ahmadinejad's plans for presidential envoys stationed abroad were vetoed by Supreme Leader Ali Khamenei over the foreign ministry's concerns it would create a parallel diplomatic service.
Mr Mottaki had faced criticism in Iran over the international pressure on the country to halt its nuclear enrichment programme.
A fourth round of UN Security Council sanctions was imposed in June.
But recently concluded talks in Geneva ended with an agreement to hold more talks in Istanbul next month.
Iran insists it wants only atomic energy but a number of Western countries suspect it of trying to build nuclear weapons.
A well-known figure inside Iran, Mr Salehi led the early response to the fatal attacks in Tehran two weeks ago on two prominent nuclear scientists.
Mr Salehi now gets to take his enthusiastic support of Iran's nuclear ambitions on to a wider stage, analysts say.
Talks 'must continue'
German Foreign Minister Guido Westerwelle urged Iran to continue negotiations over its nuclear programme, saying the dismissal should not cause "an interruption or a delay in the talks".
"The talks have started and they must continue, whatever the political make-up may be," AFP news agency quoted Mr Westerwelle as saying ahead of a meeting of EU foreign ministers in Brussels.
Germany has been involved in the Geneva talks along with the five permanent members of the UN Security Council - the US, UK, China, France and Russia.
Neither Mr Mottaki nor Mr Salehi was part of the Iranian negotiating team in Switzerland, which was headed by the secretary of Iran's Supreme National Security Council, Saeed Jalili.
A career diplomat, the 57-year-old speaks fluent English, Turkish and Urdu, and gained a postgraduate degree in international relations from Tehran University in 1991.
His departure from the foreign ministry rids President Ahmadinejad of a critic at close quarters, analysts say, but the move may yet cause problems in a parliament that is increasingly unhappy with its presidency.