Norodom Sihanouk, Cambodia’s former king, died in Beijing early Monday morning at the age of 89, a government official said.

The former king was in Beijing for a medical treatment and suffered a heart attack. He died at 2 a.m. this morning, according to Cambodia’s deputy prime minister Nhiek Bunchhhay.

Sihanouk endured the political turmoil in his country from when the Vietnam war broke out until Pol Pot’s Khmer Rouge and had been notorious for “switching allegiances”. Sihanouk won independence from France in 1953, severed relations with the US during the Vietnam War and allegedly sided with the communist Khmer Rouge.

“He has a mixed legacy,” David Chandler, a US diplomat stationed in Cambodia in the 1950s, said. “His principles were self-preservation and terrific patriotism. He made people feel that they were worthwhile and their country was worthwhile”.

Prince Sisowath Thomico, a member of the royal family and Sihanouk’s assistant, said the former king had dedicated his life “for the sake of his entire nation, country and for the Cambodian people”. “His death was a great loss to Cambodia,” Thomico told AP.