Japanese Prime Minister Shinzo Abe has announced he is resigning after less than a year in office.
Mr Abe left his news conference to bows from officials
Mr Abe had been facing growing calls to quit since his party lost upper house elections in July, and opinion polls showed he was increasingly unpopular.
Visibly distressed, he told a packed news conference that Japan needed a new leader to "fight against terrorism".
His party is set to meet next week to pick a new PM, but analysts say a fresh general election is unlikely.
Days earlier, Mr Abe had staked his job on extending Japan's naval support for the US-led mission in Afghanistan beyond a current November deadline.
News of the resignation, coming just before a parliamentary debate on the issue, took many analysts by surprise.
Mr Abe, who is seen as a nationalist, took over as prime minister a year ago. At 52, he was Japan's youngest post-war head of government.
But his poll ratings plummeted amid a row over pensions and a series of financial scandals involving some of his cabinet ministers.
The ruling Liberal Democrat Party is due to meet on 19 September to choose a new leader, who will automatically become prime minister.
Their secretary-general, Taro Aso, a close Abe ally who is seen to share most of his hawkish views on security policy, is the most likely candidate for the post.
Mr Abe did not give a date for his departure from office but said he had instructed party leaders to search for a new premier.
ROAD TO RESIGNATION
Sept 2006: Shinzo Abe is elected as PM, with long agenda of reforms
Early 2007: Series of scandals involving senior ministers
July 2007: LDP loses control of Japan's upper house for the first time in its history.
27 Aug: Abe reshuffles his Cabinet
9 Sept: Abe stakes his job on extending Japan's support of US-led mission in Afghanistan
12 Sept: Abe announces he is stepping down
"In the present situation it is difficult to push ahead with effective policies that win the support and trust of the public," he said.
"I have decided that we need a change in this situation... The people need a leader whom they can support and trust," he added.
Cabinet-level resignations and the disastrous defeat at the recent upper house elections left Mr Abe unable to gain momentum on any of his major policies.
Mr Abe had been due to answer questions in parliament later on Wednesday over plans to extend the Japanese naval mission in support of US-led operations in Afghanistan.
Although he had pledged on Sunday to quit if he did not get parliamentary approval for the extension, on Wednesday he suggested his departure might aid passage of the bill.
Japan's navy refuels US aircraft in the Indian Ocean
"I believe that my resignation will let Japan continue to fight against terrorism under a new prime minister," he said.
Mizuho Fukushima, head of the opposition Social Democratic Party, condemned the timing as "irresponsible", adding that he should have left office after the July election defeat.
Koichi Haji, chief economist at NLI Research Institute, also said the move had come as "a huge surprise".
"He said he would risk his job in passing the anti-terrorism law, so I don't know why he is resigning before making the effort," he said.
Mr Haji suggested the resignation would have only limited impact on economic policy but he did expect stock prices to "get hit" because of the political uncertainty.