Prime Minister Shinzo Abe said Friday he will resign due to a flare-up of his chronic intestinal disease, ending his nearly eight-year stint as Japan's longest-serving leader, in the midst of the coronavirus pandemic, with many of his political ambitions unrealized.

Abe, who just four days ago set a record of staying in power for 2,799 consecutive days, will leave office without achieving his long-cherished goal of amending Japan's pacifist Constitution or seeing the Tokyo Olympics due to be staged next summer while still the country's leader.

"As I am no longer in a condition to respond confidently to the mandate of the people, I have decided I should not stay in the prime minister's post," the 65-year-old said at a nationally televised press conference.

The abrupt announcement, already setting off a contest for his successor, came amid falling public support for his Cabinet as many perceived his government was dealing poorly with issues stemming from the spread of the virus.

The Liberal Democratic Party, headed by Abe, is considering holding a leadership election on Sept. 15 or around that day, according to senior party lawmakers.

Abe said he had been able to keep the illness, ulcerative colitis, which led to his first resignation as premier in 2007, under control for most of his tenure, but he started to feel fatigue from mid-July and was diagnosed with a relapse earlier this month.

Abe said he thought now was the right time to step down from the top job as he believes the number of new cases of the novel coronavirus has been on a downtrend and he has been able to compile new measures to fight the pandemic, including plans to secure enough vaccines for all residents and expand testing capacity to 200,000 a day.

"I apologize to the people from the bottom of my heart for having to leave the job amid the coronavirus pandemic while many policies are still halfway toward realization," he said.

Abe said he will remain in office until his successor is chosen by the ruling party and he plans to continue his political career, running in the next general election.

Asked who he thinks should succeed him, the premier refrained from commenting.

Potential candidates include Fumio Kishida, the LDP policy chief and a former foreign minister, Yoshihide Suga, known for his behind-the-scenes coordination skills who has been the chief Cabinet secretary since Abe returned to power in late 2012, and Shigeru Ishiba, a former defense minister who has often been critical of the prime minister.

But Finance Minister Taro Aso, who doubles as deputy prime minister, said during a meeting Friday night of his party faction that he will not aim to become the next LDP president, according to an attendee at the gathering.

The LDP will decide next Tuesday on how to hold its leadership election, with parliamentarians and representatives of local chapters likely to cast ballots, instead of all party members, according to sources familiar with the matter.

Japanese Prime Minister Shinzo Abe speaks at a press conference at his office in Tokyo on Aug. 28, 2020. Abe announced his intention to step down, citing his declining health. (Kyodo)

Abe's decision to quit came as a surprise to many, including his close aides. "I was taken aback," Tomomi Inada, one of the aides, said at LDP headquarters, noting the announcement was all too sudden and unexpected.

Financial markets reacted sharply to the news, with Japan's Nikkei Stock Average briefly diving more than 2 percent from Thursday while the yen strengthened against the U.S. dollar.

Abe made two hospital visits this month, only a week apart, for what his aides called health checkups after he was reported as having vomited blood at the prime minister's office in early July.

Questions about Abe's health had been raised from time to time after he unexpectedly resigned due to worsening of his illness in 2007, only a year after becoming the country's youngest premier in the postwar era at age 52.

After returning to power, Abe said he had overcome the intestinal disease with the help of a new drug. On Monday, he became Japan's longest-serving prime minister by number of consecutive days in office, eclipsing the previous record held by his great uncle Eisaku Sato (1901-1975).

His government's measures to deal with the pandemic have faced criticism, such as over the distribution of washable cloth face masks, which arrived too late and turned out to be too small for many.

The masks became known as "Abenomask," which means "Abe's mask" in Japanese and is a pun on his touted "Abenomics" economic policy package that calls for bold monetary easing by the Bank of Japan, generous fiscal spending and deregulations to spur economic growth.

The government also drew flak for suddenly abolishing its plan to offer 300,000 yen ($2,830) to financially struggling households amid the pandemic and deciding to provide 100,000 yen to each resident, and for trouble with online applications.

A Kyodo News opinion poll in August found 58.4 percent had been discontent with the government's handling of the pandemic. The approval rate for Abe's Cabinet, which stood at 62 percent at the start of his second stint, came to 36.0 percent in August.

Women read an extra edition of a newspaper in Tokyo on Aug. 28, 2020, after media reported that Japanese Prime Minister Shinzo Abe will step down from his post due to a health problem. (Kyodo)

During Friday's press conference, Abe said it was "gut-wrenching" to have to leave the job while still trying to guide the Japanese economy out of deflation, sign a peace treaty with Russia, and amend the Constitution.

He also said he is pained by his failure to resolve the abduction of Japanese nationals by North Korea in the 1970s and 1980s.

Abe had initially appeared to be on course to shore up the country's economy with Abenomics by setting the inflation target at 2 percent and introducing massive monetary easing, which has given a boost to Japanese stock indexes and employment.

The positive economic impact has helped Abe ride out a string of money and favoritism scandals engulfing him and his Cabinet members, including the dubious sale of state-owned land to a school operator linked to his wife Akie.

But the fruits of his policies were nearly wiped out by the novel coronavirus, causing a practical halt of economic activities.

He raised the consumption tax twice, to 8 percent in April 2014 and to 10 percent in October 2019, but Japan is still far from achieving fiscal health.

Abe was often regarded as a hawkish conservative seeking to raise Japan's profile overseas.

In 2014, he went ahead with a reinterpretation of the pacifist Constitution to enable the use of collective self-defense -- defending allies even without an attack on Japan itself -- and expanded the role of its defense forces under new security legislation in 2016.

In the diplomatic arena, Abe was a familiar face in international gatherings and Japanese government officials said he could talk frankly with many foreign leaders, notably U.S. President Donald Trump, who has become his golf buddy.

But the abduction issue remains unresolved even though Abe said it was "the highest priority" for his administration, and no date has been fixed for a summit with North Korean leader Kim Jong Un despite Abe's overtures.

Trump raised the issue when he held his second summit with Kim in the Vietnamese capital of Hanoi in February 2019, at Abe's request.

Negotiations toward signing a postwar peace treaty with Russia have hit a snag as well. Tokyo-Moscow ties have remained hampered by a decades-old territorial row over Russian-held islands off Hokkaido.

Gist of Abe's press conference announcing his resignation

Abe says:

-- resignation meant to avoid his health issue creating leadership vacuum.

-- he needs prolonged treatment for ulcerative colitis.

-- he lost confidence in his ability to serve Japanese people.

-- now is the only time he could resign amid the novel coronavirus pandemic.

-- he will remain in office until his successor is selected.

-- he apologizes to the Japanese people for stepping down at this time.

-- it is with utmost regret that he failed to amend the Constitution, bring Japanese abductees home from North Korea.

-- will continue his political career, run in next general election.

Japanese Prime Minister Shinzo Abe bows during a press conference at his office in Tokyo on Aug. 28, 2020, after announcing his intention to step down, citing his declining health. (Kyodo)

IN PHOTOS: Prime Minister Shinzo Abe's government

Chronology of major events of Prime Minister Shinzo Abe's government

Sept. 20, 2006 -- Abe becomes president of the Liberal Democratic Party after its leadership election.

Sept. 26 -- Abe appointed Japan's 90th prime minister.

July 29, 2007 -- Abe presides over the LDP's crushing defeat in the House of Councillors election.

Sept. 12 -- Abe announces his intention to resign as prime minister.

Sept. 26, 2012 -- Abe returns to the LDP presidency after its leadership election.

Dec. 16 -- LDP regains majority in the House of Representatives election.

Dec. 26 -- Abe becomes prime minister for the second time after the LDP and its coalition partner New Komeito win back the lower house.

July 21, 2013 -- The ruling coalition secures a majority in the upper house, ending the divided Diet.

Dec. 26 -- Abe visits the war-linked Yasukuni shrine in Tokyo, becoming the first prime minister to do so in seven years and drawing a backlash from China and South Korea.

April 1, 2014 -- Japan's consumption tax is raised from 5 percent to 8 percent.

July 1 -- The Cabinet approves a controversial reinterpretation of the Constitution allowing Japan to come to the aid of allies under armed attack in collective self-defense.

Dec. 14 -- The ruling coalition retains a two-thirds majority in the lower house election.

Sept. 8, 2015 -- Abe re-elected unopposed as LDP president.

Sept. 19 -- Japan enacts security legislation aimed at expanding the scope of the Self-Defense Forces' operations overseas.

July 10, 2016 -- The ruling coalition gains a two-thirds majority in the upper house election.

Oct. 22, 2017 -- The ruling coalition retains its two-thirds majority in the lower house election.

Sept. 20, 2018 -- Abe secures a third consecutive term as LDP leader.

July 21, 2019 -- The ruling coalition wins a majority of contested seats in the upper house election but falls short of the two-thirds of seats needed to propose amending the pacifist Constitution.

Oct. 1 -- Japan's consumption tax rate is raised to 10 percent from 8 percent, after twice being delayed.

March 24, 2020 -- Abe and the International Olympic Committee agree to postpone the Tokyo Olympics for one year due to the novel coronavirus pandemic.

April 7 -- Abe declares a state of emergency for seven prefectures over the pandemic.

Aug. 17 -- Abe checks in at a Tokyo hospital for what an aide calls a "regular health checkup."

Aug. 24 -- Abe revisits Tokyo hospital for additional checkups and marks record as Japan's longest-serving prime minister in terms of consecutive days in office.

Aug. 28 -- Abe announces his resignation as prime minister.