A flag flies at half-mast in Tiananmen Square as China prepares to cremate former premier Li Keqiang
A flag flies at half-mast in Tiananmen Square as China prepares to cremate former premier Li Keqiang AFP

Flags flew at half-mast in Beijing on Thursday as China prepared for the funeral of late ex-premier Li Keqiang, a reform-minded bureaucrat who was once tipped as the country's future leader but was eclipsed by Xi Jinping.

Li died from a heart attack in Shanghai at just 68 years old last week, less than a year after stepping down as premier.

A career bureaucrat and fluent English speaker, Li's support for liberalisation and economic reform often drew contrast with the more centralising and domineering tendencies of Xi's rule.

But in an official obituary, China's ruling Communist Party described Xi's one-time political rival as a "time-tested and loyal communist soldier".

It also urged the Chinese people to turn "grief into strength" by rallying even closer around the leadership and the party.

In central Beijing's Tiananmen Square, flags were flying at half-mast early Thursday, AFP journalists saw.

State news agency Xinhua reported that flags would fly at half-mast at government buildings across mainland China, as well as in the semi-autonomous regions of Hong Kong and Macau.

Li will be cremated later in the day at a ceremony likely to be attended by the country's top leadership.

His time as premier saw a shift from the more consensus-based rule associated with former leaders to the concentrated power of Xi.

And the appointment of Xi ally Li Qiang as his successor was seen as a sign that his reformist agenda had fallen by the wayside as Beijing tightened its grip over the economy.

Following his death, trending comments included a quote from Li Keqiang in late 2022, when he insisted that the process of China's reform and opening up could not be stopped.

"The Yellow River and Yangtze River will not change course," web users wrote, quoting Li.

Authorities have been on high alert for any hints that public mourning for the reformist could translate into criticism of the current leadership.

On social media platform Weibo Thursday, over 20,000 comments were listed under a hashtag commemorating Li shared by state broadcaster CCTV.

But only 13 were visible, suggesting discussion was being censored.

The comments that remained were distinctly apolitical, wishing the late premier "farewell" and promising he would "forever be in our hearts".

"China's good leader, you are the one who has contributed to the country and you will always live in our hearts," one read.

Elsewhere online, a post on Li from the Communist Youth League of Fujian province listed 50 comments -- none of which were visible.