They howled and whimpered and scrubbed raw eyes with fists. They flailed their arms in grief and marched in their thousands to the capital's landmarks. But no one, outside of North Korea, really knows what North Koreans felt at news of Kim Jong-il's death.

There was shock, of course. Some perhaps wept from sorrow for their Dear Leader, some from sorrow for themselves. Some cried for fear that inadequate public anguish might damn them, and some from anxiety about what lay ahead. Kim veiled his country throughout his life and uncertainty shrouded his death.

State media said he died at 8.30am on Saturday, felled by a heart attack "due to physical and mental overwork", as he travelled by train on one of his innumerable inspection visits. There had been not a whisper of anything unusual in the two days before the announcement.

The official news agency KCNA swiftly hailed his third son, Kim Jong-un, as the "great successor" and "the eminent leader of the military and the party". The young man, thought to be just 28, has been groomed as heir since his father's apparent stroke in 2008.

The 69-year-old left his son a nuclear-armed but impoverished country where food is scarce and human rights abuses rife, and his unexpected death sent a chill far beyond the 24 million inhabitants of North Korea. Politicians in Washington, Seoul, Tokyo and beyond weighed the prospects of a third generation of this communist dynasty with the risk of regional instability. Concerns were underscored by South Korean media reports on Monday that the North had fired short-range missiles, although the Yonhap news agency said the tests had been conducted before the death announcement. The defence ministry in Seoul did not comment.

The South's military was already on high alert, while a spokesman for the Japanese prime minister said he had set up a crisis management team.

Officials in the Obama administration, due to hold talks with the North this week and rumoured to be pondering an aid-for-disarmament deal, said it was closely monitoring developments. The UK foreign secretary, William Hague, said in a statement it was a difficult time for the North Korean people, but could prove a turning point. He urged the country to take steps towards the resumption of the stalled six-party denuclearisation talks.

It was left to China, the North's chief ally, to lament Kim's passing. "We feel incomparably anguished, and offer our deepest condolences to the entire North Korean people," the top leaders said in a statement. They described Kim as a great leader and close friend of China, adding that they were sure the Korean people would unify under his son's leadership.

It was a rare encomium. In the wider world Kim was mocked as much as reviled. That is hardly surprising: the claims of his propaganda machine grew ever more extravagant over the years. But those who dismissed him – as a crazed and erratic nuke-toting maverick; as a "pygmy" (George Bush's word); as a pompadoured, platform-shoed buffoon, in the image by Team America perhaps most widely disseminated – underestimated the man.

By turning his failing country into a nuclear state, he reinforced its pariah status, but wielded an influence he could never have otherwise achieved. There was logic in the threats to turn Seoul to ashes, as there was in the shelling and missile launches and nuclear tests. "He left the country with the ultimate deterrent. He ensured it won't be Iraq and won't be Libya," said John Delury, a professor at Yonsei University in South Korea, on Monday.

Behind the oversized, tinted glasses "was a man of some skill", said James Hoare, the former British charge d'affaires in Pyongyang. Foreigners who negotiated with him thought him sharp and knowledgeable, good at mastering briefs, but willing to refer to aides when necessary.

"He was competing in a hostile world and his solution might not be yours or mine, but his country is still there and the elite has survived – which is really what they are concerned with," said Hoare.

The clownish image was still less fair to the people he ruled with an iron grip. Observers have called the country the world's only Stalinist theme park, but there was nothing entertaining about it. Around 200,000 North Koreans are believed to be in prison camps thanks to the system of collective punishment.

Kenneth Roth, executive director of Human Rights Watch, described the country as "a human rights hell on Earth". "Kim Jong-il ruled through fear generated by systematic and pervasive human rights abuses including arbitrary executions, torture, forced labour and strict limits on freedom of speech and association," he said in a statement.

North Korea has long dismissed such criticisms as the jealous and destructive lies of capitalist aggressors. But experts say even its vast propaganda and state security apparatus has struggled to counter increasing domestic cynicism about the regime, which has proved incapable of meeting its people's basic needs. While Kim enjoyed sipping cognac and dining on sushi, his country has struggled with food shortages since the devastating famine of the 1990s, in which hundreds of thousands of people died.

"When the history of North Korea is written I think [his time] is going to be a pretty dark chapter," said Delury. "It was doing well in the 50s; it was starting to have problems in the 1970s, but not totally; it was grinding down in the 80s before the end of the socialist block. Then right after Kim Il-sung dies, it goes into freefall. You go from the paternal rule of Kim Il-sung to famine in the space of a couple of years. "To some extent it was the cards handed him … [But] in the end that's going to be his legacy."

Kim's efforts to transform foreign relations did better. Yet dramatic improvements in dealings with the South, the US and Japan were soon reversed by his own decisions and those of foreign leaders.

In North Korea's media, of course, there was only gratitude and sorrow. "It is the biggest loss for the party … our people and the nation's biggest sadness," a tearful, black-clad anchorwoman told viewers as she announced Kim's death on television. "At this moment of greatest sorrow and grief, people feel as if the sky is falling down. The hearts of all of them are now filled with stronger faith in victory, optimism and solemn pledge," KCNA said.

Footage showed anguished citizens hammering at pavements in Pyongyang; sobbing schoolchildren marshalled into public view; soldiers falling to their knees with undiluted grief. "When I see the videos I certainly don't believe in the first image of a total outpouring of grief. But nor do I believe that it is totally an act and they want to overthrow the government," said Delury.

Associated Press reported that people in the streets of Pyongyang began crying when they learned of Kim's death. Staff at the Koryo hotel, which usually accommodates foreigners, were in tears. In Beijing, waitresses at a North Korean restaurant wept hysterically and fled the room on learning the news.

Korea specialist Dr Leonid Petrov, of the University of Sydney, said that while many North Koreans would be genuinely distraught, "it will not be as dramatic as it was in 1994 when Kim Il-sung died … political cynicism is growing." He predicted a long and "extremely convenient" state of mourning. Kim's death comes days before the beginning of 2012, which the regime has long heralded as a year of glory. "[Now] they don't need to honour the promise that North Korea will become a strong, powerful and prosperous state … The population will be required to work hard for long hours with very few celebrations of Kim Il-sung's centenary," Petrov added.

KCNA said Kim Jong-il's bier would rest at the Kumsusan Memorial Palace in Pyongyang – where his father's embalmed body is displayed – before the funeral on 28 December. A national memorial service the following day, ending the official mourning period, will be marked with the firing of guns, the sounding of sirens and a three-minute silence.

But already the transition of power has begun. "The Korean people have suffered the great loss," KCNA said on its website, "but are decisively rising up as they have Kim Jong-un, great successor to the revolutionary cause … prominent leader of the party and the army and people [of North Korea] who is standing in the vanguard of the Korean revolution. He is another great person produced by Korea who is identical to Kim Jong-il."

While the Dear Leader was groomed for well over a decade before his succession, Kim Jong-un's elevation has been far more abrupt. "I think the North has done quite a bit to accelerate the succession process," said Daniel Pinkston of the International Crisis Group. "So I think at least in the short term they will coalesce around the next generation of leadership and watch and see whether his son will be able to consolidate power."

The official death notice stressed that Kim Jong-il had continued his father's legacy, and his son would do the same. That reflected the country's Confucian culture, but also the extent to which the regime still bases its authority on Kim Il-sung's. The country's founder remains "eternal president" 17 years after his death.

"Kim Jong-un's leadership provides a sure guarantee for creditably carrying to completion the revolutionary cause … started by Kim Il-sung and led by Kim Jong-il to victory," said the notice.

The Dear Leader did not wield the same power as his father, essentially ruling with the army, and experts predict that Kim Jong-un's authority will be even more contingent on the actions of the military and political elite. His aunt and her husband – who, like the "young general", were promoted last year – are expected to be key. Some wonder if his uncle is a potential challenger; others see him as a protector.

Prof Jennifer Lind, an expert on the regime at Dartmouth College, noted: "We don't know anything about how people in North Korea – the political and military elites – think about [Kim]. There is always a chance of unhappy people who might contest his succession.

"But that same group of people are going to be pretty afraid of unleashing any chaos or instability that might lead to collapse and reunification – which they would pretty much equate with a death sentence for themselves."

While some warned the new leader might sabre-rattle to help establish himself, Petrov said Pyongyang could instead seek to engage with the international community. "They will try to use it to resume negotiations with the US, saying there is a new leader so why not go and talk," he predicted.

In the short term, the country is shutting down even further. Foreign delegations will not be accepted during the mourning period. "Come back next year," said staff at the Beijing embassy, when asked if visas were available.

Any hopes that Kim's death could spark grassroots political change are wildly optimistic. There is no civil society and communications are tightly monitored. Instead, groups with contacts in Pyongyang said they were expecting an even greater clampdown on communications.

"We're expecting some form of lockdown on communications and travel in the immediate period as North Korean authorities move to stabilise the situation and prepare for mourning," said Geoffrey See, managing director at Chosun Exchange, a Singapore-based non-profit group that promotes academic exchanges with North Korea.

The Daily NK, an online news service that monitors North Korea from Seoul, said the regime had moved quickly to stifle potential unrest, including the closure of markets and the imposition of a curfew in Musan, a city in North Hamkyung province near the border with China. It quoted sources as saying that local workers and party officials were ordering residents not to leave their homes, adding that security agencies had posted agents on the streets and in alleyways "to control civilian movements".

"Not even children are allowed to go out," one source said.

Kim's sudden death, it added, had caught people by surprise. "Nobody had the slightest idea about [his] death even right before they saw the broadcast," another source said. "You can hear the sound of wailing outside."