Australian Alek Sigley who went missing in North Korea last week has been "released and safe", Australian Prime Minister Scott Morrison has said.
It comes after a meeting between officials from the Swedish embassy in Pyongyang and the North Korean government.
Australia does not have its own embassy in the North Korean capital.
Mr Sigley, 29, was pursuing a master's degree and running a tourism business in Pyongyang.
It is not known why the student, a fluent Korean speaker, had been detained.
The news of his release was first reported by specialist website NK News which said he was safely in China and would travel on to Japan.
"I'm ok, yeah, I'm good, I'm very good," Mr Sigley is seen saying on footage reportedly showing his arrival in Beijing, according to Australian media.
The 29-year-old's father later told local news outlets that their family was "over the moon that he is safe and sound".
"Last week has been very difficult... we're just happy that the situation has been resolved. He tried to ring me a few minutes ago, I will talk to him some time today," Gary Sigley told local outlets outside their family home in Perth.
News of Mr Sigley's release was announced by Mr Morrison to parliament on Thursday. He said it was the result of "discreet, behind the scenes work of officials in resolving complex and sensitive consular cases".
"We are pleased to announce that Mr Alek Sigley has today been released from detention in the Democratic People's Republic of Korea (DPRK). He is safe and well." Mr Morrison said.
He said Swedish authorities had met with senior officials from the DPRK on Wednesday and "raised the issue of Alek's disappearance on Australia's behalf".
"I would like to extend my deepest gratitude to the Swedish authorities for their invaluable assistance."
Sweden is one of few Western countries that have an embassy in North Korea and often acts as an intermediary for countries that don't.
Hywel Griffith, BBC News Sydney correspondent
The relief felt by Alek Sigley's family, and many others across Australia, is obvious.
With no embassy in Pyongyang and no direct contact with North Korea, the Australian government was left to depend on the good-will of others to help find him. Prime Minister Scott Morrison was glowing in his praise for the way in which Swedish officials worked to secure his release.
Clearly there were concerns that publicly confronting North Korea would prove provocative and potentially harmful to Mr Sigley. Instead, careful and discreet diplomacy got the desired result.
Of course, we do not know what, if anything, was offered in return. But for now the focus is on celebrating that he is safe and well.
Who is Alek Sigley?
Mr Sigley was one of very few foreigners living in North Korea.
Originally from Perth, for the past year he had been pursuing a degree in Korean literature at Kim Il-sung University.
He also ran a business providing tours for Western tourists visiting the totalitarian, communist state.
In March, he described himself as "the only Australian living in North Korea" in a piece published by The Guardian.
Last week, his family and friends lost contact with him, sparking fears he might have been detained.
Several foreigners have previously been detained in North Korea, sometimes for illegally entering the country or for what Pyongyang terms "hostile criminal acts against the state".
US student Otto Warmbier was jailed in North Korea in 2016 after being accused of stealing a propaganda sign during an organised tour.
He spent 17 months in detention, and later died days after he was returned to the US in a coma.