South Korea's spy agency believes it has solved the mystery of Kim Jong-un’s 40 day disappearance – and it does not involve gout, an attempted coup or an addiction to Swiss cheese.

Instead, the National Intelligence Service (NIS) believes a foreign doctor operated on the leader of North Korea to remove a cyst from his right ankle because he was suffering from Tarsal Tunnel Syndrome.

Kim is believed to have been operated on by doctors in September or October.

Park Byeong-seok, an aide for opposition politician Shin Kyung-min said the spy agency told legislators in a closed-door briefing the condition could recur of Kim's obesity, smoking and heavy public schedule.

Lim Dae-seong, an aide to ruling parliamentarian Lee Cheol-woo, who also attended the briefing, said the spy agency identified Kim's condition as Tarsal Tunnel Syndrome.

The syndrome is caused by the compression of a nerve, sometimes because of a cyst. Surgery is generally considered a last resort after other treatments are unsuccessful.

After last being seen in state media on 3 September, Kim reappeared on 14 October, walking with a cane. He was seen hobbling in his final public appearance before disappearing from view, prompting speculation among some that his love of Swiss cheese had led to gout.

The speculation over his absence was particularly intense because of the Kim family's importance to impoverished, nuclear-armed North Korea. The family has ruled the country since its founding in 1948 and Kim is invariably at the centre of all state propaganda.

In pictures: Life in North Korea Show all 10 1 /10 In pictures: Life in North Korea In pictures: Life in North Korea North Korea Boys play soccer in the town of Hyesan in North Korea's Ryanggang province. AP In pictures: Life in North Korea North Korea Young North Korean schoolchildren help to fix pot holes in a rural road in North Korea's North Hamgyong province AP In pictures: Life in North Korea North Korea A group of young North Koreans enjoys a picnic on the beach in Wonsan, North Korea AP In pictures: Life in North Korea North Korea Portraits of the late North Korean leaders Kim Il Sung and Kim Jong Il are illuminated on a building side as the sun rises over Pyongyang. AP In pictures: Life in North Korea North Korea North Korean men share a picnic lunch and North Korean-brewed and bottled Taedonggang beer along the road in North Korea's North Hwanghae province. AP In pictures: Life in North Korea North Korea North Korean people rest next to the railroad tracks in a town in North Korea's North Hamgyong province AP In pictures: Life in North Korea North Korea A North Korean man pushes his bicycle to a village in North Korea's North Hamgyong province. AP In pictures: Life in North Korea North Korea North Korean residents walk on a road along a river in the town of Kimchaek, in North Korea's North Hamgyong province. AP In pictures: Life in North Korea North Korea The remains of lunch sits on a restaurant table in the city of Wonsan, North Korea AP In pictures: Life in North Korea North Korea Farmers walk in a rainstorm with their cattle near the town of Hyesan, North Korea in Ryanggang province. AP

The agency also said North Korea has expanded five of its political prisoner camps, including the Yodok camp, which was relocated to the north-west city of Kilchu, according to Mr Lim. He said it believes the camps hold about 100,000 prisoners.

Mr Lim said the agency believes North Korea recently used a firing squad to execute several people who had been close to Kim's uncle, Jang Song-thaek, who was killed in a December 2013 purge.

The Yonhap news agency quoted the NIS as saying the notoriously secretive state has executed an estimated 50 people this year and demoted dozens of senior military officers.

It was not immediately clear how the information was obtained by the spy agency.