King Bhumibol Adulyadej's pivotal role in modern Thailand's development tends to obscure the fact that when he acceded to the throne in 1946, the status of the monarchy was not secure, and the young king himself was unprepared to take on the job.
Until 1932 Thailand had been ruled by an absolute monarchy, with the king exercising power over the judiciary, the appointment of government officials and over state policy.
But the pressures of the modern, globalised world intruded in 1932 when a group of soldiers and intellectuals overthrew the absolute monarchy and imposed a constitution limiting the powers of King Prajadhipok, on the throne at the time.
Unable to accept these limitations he abdicated in 1935 and lived the rest of his life in exile.
A young monarch
Bhumibol's elder brother, Ananda Mahidol, was next in line, but their mother insisted they stay away from the volatile political climate in Thailand and they were brought up in Switzerland.
As a result there was no sitting king until the family returned after World War Two in 1945 and it was not clear then what kind of monarchy might be re-established.
Following the still unexplained shooting to death of King Ananda on 9 June 1946, that task fell to the 18 year-old Bhumibol.
Until the mid 1950s the king's position was still too insecure for him to challenge the then-military strongman Phibul Songkram, who had also ruled during the war. He was not even allowed to travel freely outside Bangkok.
From the mid-1950s on, the king travelled widely, and took an active interest in rural development projects.
How effective his interventions really were is difficult to gauge, given the swirl of royalist propaganda, but they certainly established him as a caring ruler who was working hard for his people.
Today the monarch is expected to be involved in the country's development, and substantial resources have been devoted to promoting King Bhumibol's philosophy of a "sufficiency economy" - a focus on balanced development that stresses environmental and social responsibilities as much as conventional measures of economic progress.
From the mid 1960s, when central government authority was challenged in the countryside by a communist rebellion, the king's visits helped rebuff the influence of the insurgents.
King Bhumibol became an essential figure in the fight by the Thai military and its US-backers against communism, although his role became more controversial in the savage anti-leftist coup of 1976, in which dozens of students were brutally killed by the security forces and royal-backed militias, and thousands forced to flee to seek sanctuary with the Communist Party.
Throughout his reign King Bhumibol worked with a series of military-dominated administrations, prompting accusations that he was more comfortable with authoritarian than democratically-elected regimes.
The role of mediator
Critics, though, believe he shared the disdain for elected politicians held by many of Thailand's traditional elite, as money-grubbing, classless opportunists.
In interviews the king referred to politics as something unseemly with which he did not want to be associated.
One other side of Bhumibol's role was often talked about during his reign, as a mediator at times of crisis. Officially he could not intervene. But on two occasions, in 1973 and 1992, when bloody clashes between troops and protestors had taken place on the streets of Bangkok, he is credited with defusing the situation and allowing a compromise to be settled.
In 1973 he decided to allow protesting students to shelter inside his palace, undermining then dictator Thanom and forcing him into exile.
This allowed the formation of Thailand's first democratic government since the 1940s, although this brief period ended tragically in the violence and repression of 1976.
In 1992 the king mediated again, summoning a military-backed prime minister and the leader of the protest movement, and allowing video of them prostrating themselves before him to be broadcast. Following this, Thailand had enjoyed its longest period of democracy, up to the coup of 2006.
There is debate about how decisive the king's role was in these crises, but the incidents allowed him to be portrayed as the ultimate arbiter of disputes.