Bangkok: Prem Tinsulanonda, one of Thailand’s most powerful figures over the past four decades who was accused of masterminding a 2006 coup against former leader Thaksin Shinawatra, has died, the Bangkok Post reported. He was 98.

The former premier died of heart failure in a hospital in Bangkok on Sunday, the paper said, citing various media reports.

Prem served as army chief and then prime minister for nearly a decade spanning the late 1970s and 1980s. He later became the top royal adviser to former King Bhumibol Adulyadej and then his son, King Maha Vajiralongkorn, who took the throne in 2016.

More than 100,000 pro-Thaksin supporters rallied outside of Prem’s house in 2009 to demand that he step down from the king’s Privy Council, saying he engineered the former leader’s ouster in 2006. Prem had denied involvement in the coup, which has destabilised Thai politics ever since.

Thaksin and his allies have won the most seats in every Thai election since 2001, including one held in March following five years of overt military rule. The former premier, who lives in exile, called that vote “rigged” and warned the junta would seek to retain power no matter which coalition emerges.

Thai lawmakers may vote as early as this week for a new government. Prayuth Chan-ocha, who led a coup in 2014 against Thaksin’s sister Yingluck Shinawatra, is expected to return as prime minister with the backing of a military-appointed upper house. Thaksin’s allies say they have the most seats in the lower house, setting up a period of gridlock no matter who takes power.

Prem repeatedly spoke out against elected officials. In 2006, he likened governments to jockeys who ride a horse that is owned by the king. Then in 2014, Prem told reporters that Thais “should be proud” of the coup earlier that year, which he called “a great display of loyalty.”