North Korea is marking the 70th anniversary of the founding of its Communist Party, the sole controller of the state. Kim Jong-un, the grandson of the man who cemented the party's rule, will preside over spectacular celebrations.

But the story of how the party transformed from a political organisation to an institutionalised family dictatorship is a strange and bloody one, as North Korea leadership expert Michael Madden explains.

A teenager with an idea

Image copyright MARK RALSTON Image caption Kim Il-sung still remains the very centre of North Korean propaganda

On 17 October 1926, a teenage Kim Il-sung, who would later become North Korea's first leader, set up the "Down-with-Imperialism Union". It was founded, so the propaganda goes, to fight against Japanese imperialism and to promote Marxism-Leninism.

The North Korean propaganda machine would like to celebrate this as the anniversary of the Party's foundation. For others, the true foundation is 1949, when South and North Korean Communists finally came together in a coalition that aimed to lead one unified Korea.

But 1945 saw the establishment of the North Korean Bureau of the Communist Party of Korea. This became the body which rules today.

The making of a leader

Image copyright Getty Images

Kim Il-sung was something of an urban legend known for a daring raid on the town of Pochonbo in 1937 where, at the age of 24, he is said to have led a military unit to capture a Japanese-held town on the Korean border. It was seen as a major military success, even if it only lasted for a few hours.

The Soviets put him very much at the centre of the strange coalition that became the North Korean Workers Party. This included Chinese Korean activists, members of the ethnic Korean diaspora from Russia, South Korean Communists who migrated North and Kim's guerrilla fighters.

In the years after 1945 other names held nominally key positions in the North Korean Communist structure, but Kim Il-sung remained the main figure. He did not have a major public profile, but the Soviets worked on this slowly but steadily.

The first of the bloody purges

Image copyright Getty Images Image caption A picture of Kim Il-sung from around 1950, as the Korean war began and as he began to consolidate power

With Kim Il-sung firmly in power by 1950, reunification with the South remained high on the North Korean agenda and so the Korean war began.

He began consolidating his power by eliminating those communists with South Korean links - many accused of spying.

Then those Russian and Chinese Koreans who were part of the early history of the party were picked off through exile, imprisonment and disappearances. Famously, Russian and Chinese-linked party officials who formed a plot against Kim Il-sung were eliminated after a dramatic showdown at a party congress in 1956 known as the August Faction Incident.

Some of their descendants may still reside in political detention facilities.

They manufactured a caste system

Image copyright Getty Images Image caption Ordinary North Korean workers would likely be classed as "waverers"

Just one year later the infamous Songbun "caste system" was adopted by the Communist Party. It was effectively a massive political purge of North Korean society through social classification.

There are few definitive guides to the Songbun and it is known to be both complex and opaque but in essence people were divided into three main groups: the core class, the wavering class and the hostile class. This so-called "hostile" class were essentially those deemed a political threat, and had no hope of any personal or career advancement.

The Organisation Guidance Department of the Communist party controlled it and many experts believe this to be the true centre power in the 1960s, when the authorities began classifying every citizen as a friend or foe.

The cult of the leader was born

Image copyright Getty Images

A political bloodbath took place between 1967 to 1971 when 17 senior officials were purged.

Purges targeted members of Kim Il-sung's own original guerrilla faction and set up his control over the army as well. The military leadership in place when the USS Pueblo spy ship was captured by North Koreans in 1968 - a huge coup - were taken out. In contrast to other purges, some of them returned to power years later.

And after the 5th Party Congress in 1970, the party completed its transformation from a typical Marxist-Leninist political party to one that venerated Kim Il-sung and became responsible for implementing his will.

How it became a family affair

Image copyright Getty Images Image caption Despite other changes, touring state facilities has remained a core part of the job description for North Korea's leaders

The next step was to ensure his son gained pole position. Kim Jong-il rose to senior party positions in 1973 and 1974, most importantly as head of that all-important Organisation Guidance Department.

Through his senior party positions he elevated a number of his political supporters. He also punished those who dared challenge him such as his step-mother Kim So'ng-a'e who pressed the claims of her son Kim Pyong-il as hereditary successor.

Using control over North Korean state media and his ties to the internal security agencies, Kim Jong-il effectively sidelined his step-mother and half-siblings. In the 1990s, Kim Jong-il purged dozens of senior officers during the early 1990s, giving him control over the military.

The wilderness years

Image copyright AFP Image caption Called The Arduous March in state propaganda, North Korea suffered years of famine in the 90s

After the death of Kim Il-sung in 1994 and because of the wider social impact of the North Korean famine, known as The Arduous March, the Party became somewhat moribund. Its Central Committee did not hold a meeting, one they publicised anyway, from 1993 until 2010. Key vacancies remain unfilled.

It still had administrative duties but as a political entity it was diminished. But in 2010, Kim Jong-il revived the party as a political institution to cope with his declining health and to boost the succession of his son Kim Jong-un.

The party is now the family

Image copyright AFP/KCNA Image caption Officials note the advice dispensed by the leader, here about an excursion boat built in time for the celebrations

Under Kim Jong-un, the party has thrived as a political institution. He has been involved in the party's revival since 2007, and as supreme leader, like his grandfather, he has used the party's Political Bureau to publicly dismiss wayward officials as he did with former military chief of staff Ri Yong-ho and even his own uncle Jang Song-thaek.

He is also building his power base through the party's Central Military Commission. He is very much continuing the family legacy of keeping it in the party.