BEIJING — Li Rui, who over nearly four decades went from being one of Mao Zedong’s personal secretaries in the 1950s to a Communist Party critic, revisionist historian and standard-bearer for liberal values in China, died in Beijing on Saturday. He was 101.

The cause of death was organ failure, brought on by a lung inflammation and cancer of the digestive tract, according to his daughter, Li Nanyang, who spoke with doctors at the Beijing hospital where Mr. Li had been receiving treatment.

Blunt, brash and quick-witted, Mr. Li’s experience epitomized the hopes and disappointments of a generation. His perseverance and longevity made him one of the most influential government critics in the seven-decade history of the People’s Republic of China. His work also helped reshape historians’ understanding of key moments in modern Chinese history — especially Mao’s responsibility for the catastrophic Great Leap Forward, in which famine killed more than 35 million people — while his political connections allowed him to protect moderate critics and make open appeals for free speech and constitutional government.

But Mr. Li was no dissident. He died a Communist Party member, enjoying the privileges that came from having joined the party in 1937, earlier than almost anyone else alive in China. He had a large apartment, a generous pension and lavish benefits, such as top-flight medical care. The party imprisoned him, exiled him, and almost starved him to death, but even when it expelled him he eventually returned in hopes of effecting change from within.