Alek Sigley's detention came days before and a meeting between Trump and Kim Jong

An Australian student who was released after being held in North Korea had been "spying" in the reclusive country, state media said Saturday.

Alek Sigley, 29, disappeared around two weeks ago prompting deep concern about his fate, but was freed and flew to Japan on Thursday.

Official North Korean news agency KCNA said Sigley had admitted "he had been spying by collecting our internal information and sharing with others and repeatedly asked for our forgiveness for infringing on our sovereignty".

It said Sigley -- one of just a handful of Westerners living and studying in North Korea -- had been detained on June 25 for promoting propaganda against the country online, including on specialist website NK News, which rejected the accusations.

"Sigley, upon request by anti-DPRK news outlets such as NK News, on numerous occasions transferred information that he gathered while travelling to every corner of Pyongyang using his status as an international student, including photographs and analysis," it said, using the initials of North Korea's official name.

"The government of DPRK has exercised humanitarian forbearance and deported him from our grounds on July 4."

Sigley's detention came just days before a G20 summit and a landmark meeting between President Donald Trump and North Korean leader Kim Jong Un.

Trump was closely involved in the case of University of Virginia student Otto Warmbier, who was imprisoned during a tour of the authoritarian state in 2016.

Doctors said Warmbier suffered severe brain damage while in detention, fell into a coma and died days after arriving back in the United States, aged 22.

Sigley was much more familiar with the country and spoke fluent Korean.

He organised tours to North Korea, and ran a number of social media sites, which usually had a stream of apolitical content about life in one of the world's most secretive nations.

His blog posts focused on everyday Pyongyang -- everything from the city's dining scene to North Korean app reviews -- and he married his Japanese wife there last year.

No interviews

Chad O'Carroll, director of the NK News, said in a statement on Saturday that Sigley's columns for the site "presented an apolitical and insightful view of life in Pyongyang".

"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," he said.

On Friday, Sigley said he was planning to "return to normal life" but offered no details of his detention, adding he would not be conducting any interviews or holding a press conference.

"I just want everyone to know I am OK, and to thank them for their concern for my wellbeing and their support for my family over the past week," he said in a statement released by representatives of his family on Friday.

However Sigley gave no indication of why he was held, how he was treated or why he was released. It said he would not make any further comment "at this time or later".

The case was also complicated by Australia's lack of diplomatic representation in North Korea.

Sigley specifically thanked Sweden's envoy to North Korea, who helped negotiate his release.

Also on Friday, Australia's Home Affairs Minister Peter Dutton cautioned Sigley against returning to Pyongyang.

"My advice will be pretty clear -- I would stay in Japan. I would go back to South Korea. I would come back to Australia. All of those would have to be better options before he returns to North Korea," Dutton told broadcaster channel Nine.