Japanese PM Shinzo Abe has announced his resignation for health reasons.
He said he did not want his illness to get in the way of decision making, and apologised to the Japanese people for failing to complete his term in office.
The 65-year-old has suffered for many years from ulcerative colitis, an inflammatory bowel disease, but he said his condition had worsened recently.
Last year, he became Japan's longest serving prime minister. His current period in office began in 2012.
He will remain in his post until a successor is chosen.
In 2007 he resigned abruptly from an earlier term as prime minister because of his struggles with ulcerative colitis, a chronic condition that he has lived with since he was a teenager.
Mr Abe has a reputation as a staunch conservative and nationalist, and for stimulating growth with his aggressive economic policy known as "Abenomics".
He has strengthened Japan's defences and boosted military spending, but has been unable to revise the constitution's pacifist Article 9, which bans a standing army for anything other than self-defence.
What did Mr Abe say?
The prime minister said his health started to decline as his ulcerative colitis made a resurgence around the middle of July.
He was now receiving a new treatment for the condition which had to be administered on a regular basis and would not give him enough time to carry out his prime ministerial functions, he added.
He said he could not make any mistakes in terms of important decision making, and therefore had decided to step down.
"I made a judgement I should not continue my job as a prime minister," he said.
"I would like to sincerely apologise to the people of Japan for leaving my post with one year left in my term of office, and amid the coronavirus woes, while various policies are still in the process of being implemented," he added, making a bow.
He also expressed regret at not fulfilling his core pledges - forcing North Korea to return Japanese citizens abducted decades ago; sorting out a territorial dispute with Russia; and overhauling the constitution to give more power to the military.
Abe's emotional farewell
By Mariko Oi, BBC News, Tokyo
Announcing his resignation at a news conference, Mr Abe spoke without the use of a teleprompter, which is unusual for him. Rather than addressing prepared questions, the prime minister mostly took questions.
He seemed drained and was at times emotional as he faced the reporters. Asked about his attempts to control his public image - for instance by pre-selecting questions for news briefings - he avoided answering by saying that his administration wasn't the first to do so.
He was also repeatedly asked who he thought should replace him, or when, to which he said it wasn't his place to weigh in. But the Liberal Democratic Party which has almost continuously been in power since 1955 has many different factions so the race is on between them to get the top job.
Those close to Mr Abe, like Chief Cabinet Secretary Yoshihide Suga or Deputy Prime Minister and Finance Minister Taro Aso, are not necessarily the most popular among voters as his administration has faced criticism for its handling of the Covid-19 pandemic.
What happens now?
Mr Abe said he would "firmly execute my duty to the end" until a replacement was chosen.
His announcement will have automatically triggered a vote within his Liberal Democratic Party (LDP) to replace him as leader.
The party will decide next Tuesday how to hold an election, Kyodo news agency reports.
This election will be followed by a parliamentary vote to elect a new prime minister.
Potential successors have already emerged, including Deputy Prime Minister Taro Aso, Chief Cabinet Secretary Yoshihide Suga, and LDP policy chief Fumio Kishida, who is rumoured to be Mr Abe's choice.
None are expected to deviate significantly from the government's current policies.
The winner would hold the post until the end of Mr Abe's term in September 2021.