Former Chinese Premier Li Keqiang died of a heart attack aged 68 in Shanghai in the early hours of Friday, state-run media reported, with his sudden death just months after retirement shocking the country.

Li died after medical efforts to save him failed following the heart attack, the official Xinhua News Agency said. He stepped down as premier in March after serving two five-year terms and was replaced by Li Qiang.

Chinese Premier Li Keqiang delivers a government report on policy directions for 2023 during the National People's Congress session at the Great Hall of the People in Beijing on March 5, 2023. (Kyodo) ==Kyodo

While serving under President Xi Jinping from 2013, Li promoted market-oriented reforms in the world's second largest economy with the policy dubbed "Likonomics." But the role of premier gradually waned as Xi concentrated power in his own hands and started a norm-breaking third five-year term as the country's leader in 2022.

During the ruling Communist Party's twice-a-decade congress in October last year, with Xi loyalists dominating the new leadership, Li left its highest decision-making body even though he was then below the party's unwritten but de facto retirement age of 68.

In an official obituary notice issued by the Communist Party and the Chinese government, Li was extolled as "a time-tested and loyal communist soldier and an outstanding proletarian revolutionist, statesman and leader" of the party and the state, according to Xinhua.

A confidant of former President Hu Jintao, with whom he worked at the Communist Youth League of China, Li was once seen as Hu's potential successor but lost out to Xi.

Born in Anhui Province in July 1955, Li joined the Communist Party in 1976. After engaging in rural labor during the Cultural Revolution, he studied law at Peking University and obtained a doctorate in economics from the university. He was also proficient in English.

Li served as the top Communist Party official of Henan Province and Liaoning Province, respectively, before joining the Standing Committee of the party's Political Bureau in 2007. He was elected vice premier at the National People's Congress in 2008.

In what appears to be his last public appearance, images of Li smiling and waving to people during a visit to Mogao Caves, a World Heritage site in northwestern China, were shared on the country's social media in late August.

Many Chinese citizens expressed shock at Li's death, posting on Weibo, the country's equivalent of the X platform formerly known as Twitter, that his death was "too sudden" and he was "too young to die," while speculating what caused his heart attack.

Some Weibo users referred to a "fierce struggle," alluding to rumors about his shaky relationship with Xi. Information that Li had a heart attack while swimming at a Shanghai hotel pool went viral, with an online booking site indicating the facility will suspend operations until early November.

A Beijing commuter said he was surprised because he had not been aware of Li's poor health and expressed regret over the death as he believed the former premier was "well-versed in economics and I thought he would continue to be active."

Japanese Prime Minister Fumio Kishida said he was "overwhelmed with grief" over Li's death in a message addressed to Xi and Li Qiang, saying the former premier "played a significant role in developing bilateral relations for a long period," the Japanese government said.

In 2018, Li visited Japan to join a leaders' meeting also involving South Korea. He had ties with veteran Japanese lawmaker Ichiro Ozawa, who invited him to his home in Iwate Prefecture, northeastern Japan, when Li was working at the Communist Youth League, an elite party organization prior to Xi's ascendancy.

Ozawa lamented Li's death, saying in a statement it is a "national loss to China" and he is in "deep sorrow."

U.S. Secretary of State Antony Blinken also expressed his condolences, while Taiwan's Mainland Affairs Council similarly offered sympathy to Li's family and said it will continue to keep a close eye on any related developments in China.

Related coverage:

China's Xi secures norm-breaking 3rd term as president

Ex-China leader Jiang Zemin, who fanned anti-Japan mood, dies at 96

China's Xi starts rare 3rd term with allies dominating leadership