Image copyright AFP/Getty Images Image caption Alek Sigley in transit in Beijing after his release from North Korea this week

North Korea says an Australian student who had been detained for several days before being released had been "spying" for news outlets.

Alek Sigley, 29, was reported missing in late June, but was freed on Thursday after Swedish officials in Pyongyang met the North Korean government.

NK News, one of the websites to publish his writing, has rejected Pyongyang's claims that he spied for them.

It said his columns only "presented an apolitical view of life in Pyongyang".

Mr Sigley, a fluent Korean speaker, had been living in Pyongyang while studying a Master's at Kim Il-sung university and running a tourism business.

Mr Sigley has not commented on why he detained. Following his release, he flew to Japan, where his wife lives.

On Saturday, North Korea's state-run news agency KCNA said that Mr Sigley had "on numerous occasions transferred information, including photographs and analysis, that he gathered while travelling to every corner of Pyongyang using his status as an international student".

He had done this "upon request by anti-DPRK [North Korea] news outlets such as NK news", KCNA added.

The government decided to deport him on humanitarian grounds after he "honestly admitted that he had been spying... and repeatedly asked for our forgiveness for infringing on our sovereignty", it said.

North Korea often accuses foreigners detained in its country of espionage or "hostile acts".

Media playback is unsupported on your device Media caption The North Korean spy who wants to go home

In a statement, NK News, a website specialising in North Korean news and analysis, said it appreciated "the DPRK's decision to promptly release Sigley on humanitarian grounds".

It said it had published six articles from Mr Sigley which showed "vignettes of ordinary daily life in the capital".

"The six articles Alek published represent the full extent of his work with us and the idea that those columns, published transparently under his name between January and April 2019, are 'anti-state' in nature is a misrepresentation which we reject."

Mr Sidley had published an essay titled: "From Perth to Pyongyang: my life as an Aussie student at Kim Il Sung University", as well as articles about North Korean fashion, apps, and restaurants.