An Australian graduate student who went missing in North Korea last week has been released from detention and is now "safe and well" in China, according to Prime Minister Scott Morrison.

Alek Sigley, 29, had been studying at a university in Pyongyang since 2014 when he lost contact with family and friends on June 25.

"I'm pleased to announce that Mr. Alek Sigley has been today released from detention in the Democratic People's Republic of Korea," Scott Morrison told Parliament on Thursday.

DANIEL HOFFMAN: DISSECTING THE NATIONAL SECURITY STRATEGY BEHIND TRUMP'S POLITICALLY RISKY MEETING IN NORTH KOREA

Alek Sigley is seen in an undated photo provided by the Sigley family. (Associated Press)

Australia and North Korea have diplomatic relations but Australia has no embassy in Pyongyang. Sweden, which has an embassy, intervened on Sigley’s behalf, with officials meeting with senior North Korean officials this week to help get Sigley to China, the Guardian reported.

"This outcome demonstrates the value of discrete behind-the-scenes work of officials in resolving complex and sensitive consular cases in close partnership with other governments," Morrison said.

The prime minister’s announcement was the first confirmation that Sigley had been detained; Morrison has not revealed the reason why the long-term student may have been held by the North Korean government.

NORTH KOREA GAVE US $2M HOSPITAL BILL OVER CARE OF AMERICAN OTTO WARMBIER, SOURCES SAY

Earlier this year, Sigley told the Guardian Australia his student visa gave him “nearly unprecedented access to Pyongyang.” He was believed to be the only Australian in North Korea, the newspaper reported. Sigley is expected to leave China for Tokyo, where his wife lives.

In 2016, American student Otto Warmbier was sentenced to hard labor while on a tour of Pyongyang. He was returned to the United States in a coma in June 2017 and died a week later.

CLICK HERE TO GET THE FOX NEWS APP

After the recent G20 summit in Japan, President Trump became the first American president to step into North Korea when he met Kim Jong Un at the DMZ on June 30 in an apparent effort to restart denuclearization talks.

The Associated Press contributed to this report.