SYDNEY/TOKYO (Reuters) - An Australian student who was detained in North Korea was freed and safely left the country on Thursday, arriving in Tokyo via Beijing later the same day after Swedish officials helped broker his release.

Alek Sigley, 29, who was studying in the North Korean capital, Pyongyang, had been missing since June 25.

“I’m OK. I’m good, I’m very good,” Sigley told reporters after arriving at Beijing airport.

He declined to comment about what happened to him in the North Korean capital of Pyongyang where he had been living. He made a peace sign as he walked through the airport.

Hours later he landed in Tokyo, walking past a throng of reporters waiting at the airport without answering their questions. Sigley is married to a Japanese woman, Yuka Morinaga.

An Australian government source familiar with the situation said Sigley was due to travel to Tokyo from Beijing.

Australian Prime Minister Scott Morrison interrupted parliament earlier on Thursday to confirm that Sigley had been freed.

Slideshow ( 4 images )

Morrison later said in a statement that Swedish authorities had helped secure the student’s release.

“This outcome demonstrates the value of the discreet, behind the scenes work of officials in resolving complex and sensitive consular cases, in close partnership with other governments,” Morrison said in the statement.

He did not say why Sigley had been detained.

Australia has no diplomatic presence in North Korea and relies on other countries such as Sweden to act on its behalf.

In a statement to Reuters, the Swedish foreign ministry said it welcomed the release.

“Sweden has acted in accordance with the agreement on providing consular services that exists with Australia and in close cooperation with Australian authorities,” it added.

Slideshow ( 4 images )

Sigley’s father, a professor of Asian studies in the western Australian city of Perth, told reporters his son would soon be reunited with his wife.

“We are extremely pleased that Alek is safe and sound,” Gary Sigley said.

Sigley was an active social media user in North Korea and regularly posted photos and blog posts about subjects such as food and fashion. Alarm was first raised that he was missing when he disappeared from his social media accounts.

He was also a regular contributor to international media about life in North Korea, which he was invariably enthusiastic about.

It was no coincidence the detention came during negotiations between North Korea and the United States, a close ally of Australia, said Asian security specialist Euan Graham.

“North Korea would not have taken an Australian citizen into custody without considering the geopolitical ramifications,” said Graham, a professor at La Trobe University in Melbourne.

The detention could have been used as leverage, he added.

On Sunday, U.S. President Donald Trump became the first incumbent U.S. president to set foot in North Korea when he met its leader, Kim Jong Un, in the region’s demilitarized zone to resume stalled nuclear talks.

The treatment of foreigners, most usually from the United States, by the secretive North has long been a contentious issue. Some have been held prisoner for years on accusations of spying.

The death of American student Otto Warmbier in 2017 after he was detained for 17 months sparked a long period of tension between the United States and North Korea.

He had been sentenced to 15 years of hard labor in 2016 for, according to North Korean state media, trying to steal an item bearing a political slogan.

Warmbier died shortly after he was flown home to Ohio in a coma.