The last two journalists working for Australian media in China have left the country after police demanded interviews with them and temporarily blocked their departures, the Australian government, and their employers said Tuesday.

Australian Broadcasting Corp.’s Bill Birtles and The Australian Financial Review’s Michael Smith landed in Sydney after flying from Shanghai on Monday night, both news outlets reported.

Both had sheltered in Australian diplomatic compounds in recent days.

GORDON CHANG WARNS CHINA 'CONFIGURING ITS MILITARY TO KILL AMERICANS'

Chinese President Xi Jinping attends the closing session of China's National People's Congress in Beijing in May. (AP)

Chinese President Xi Jinping attends the closing session of China's National People's Congress in Beijing in May. (AP)

The journalists left after Australia revealed last week that Australian citizen Cheng Lei, a business news anchor for CGTN, China’s English-language state media channel, had been detained.

Both journalists were told they were “persons of interest” in an investigation into Cheng, The Australian Financial Review reported. Seven uniformed police visited each journalist's home in Beijing and Shanghai at 12:30 a.m. Thursday, the newspaper said.

Australian Embassy officials in Beijing told Birtles last week that he should leave China, ABC reported.

Birtles was due to depart Beijing on Thursday and was holding a farewell party on Wednesday when police came to his apartment and told him he was banned from leaving the country, ABC said. He was told he would be contacted on Thursday to organize a time to be questioned about a “national security case,” his employer said.

Birtles went to the Australian Embassy, where he spent four days while Australian and Chinese officials negotiated. Smith had similarly holed up at the Australian Consulate in Shanghai.

Birtles and Smith both agreed to give police a brief interview in return for being allowed to leave the country.

Foreign Minister Marise Payne confirmed that her government had provided consular support to the two journalists to assist their return to Australia.

“Our embassy in Beijing and consulate-general in Shanghai engaged with Chinese government authorities to ensure their well-being and return to Australia,” she said.

Australia’s travel warning of the risk of arbitrary detention in China “remains appropriate and unchanged,” she added.

ABC news director Gaven Morris said Birtles was brought back to Australia on the Australian government’s advice.

“This bureau is a vital part of the ABC’s international news-gathering effort and we aim to get back there as soon as possible,” Morris said.

INDIAN LAWMAKER ACCUSES CHINESE BORDER TROOPS OF ABDUCTING 5 CIVILIANS

“The story of China, its relationship with Australia and its role in our region and in the world is one of great importance for all Australians and we want to continue having our people on the ground to cover it,” he added.

The newspaper’s editor-in-chief, Michael Stutchbury, and editor, Paul Bailey, described the situation as “disturbing.”

“This incident targeting two journalists, who were going about their normal reporting duties, is both regrettable and disturbing and is not in the interests of a co-operative relationship between Australia and China,” they said in a statement.

Relations between China and Australia were already strained by Australia outlawing covert interference in politics and banning communications giant Huawei from supplying critical infrastructure. They have worsened since the Australian government called for an independent inquiry into the origins of and international responses to the coronavirus pandemic.

Australia's journalist union, Media Entertainment and Arts Alliance, said China was no longer safe for foreign reporters.

"These outrageous attacks on press freedom place any foreign correspondents reporting from China at risk,” union president Marcus Strom said in a statement.

Birtles told reporters at Sydney's airport that his departure was a “whirlwind and ... not a particularly good experience.”

HONG KONG COPS CRITICIZED INTERNATIONALLY FOLLOWING VIOLENT ARREST OF 12-YEAR-OLD GIRL

“It’s very disappointing to have to leave under those circumstances and it’s a relief to be back in a country with genuine rule of law,” Birtles said.

Smith told his newspaper: “The late-night visit by police at my home was intimidating and unnecessary and highlights the pressure all foreign journalists are under in China right now.”

Smith said at the airport that he had felt “a little bit” threatened in China.

“It’s so good to be home, so happy, I can’t say any more at the moment, it’s such a relief to be home, so really happy,” Smith said.

CLICK HERE TO GET THE FOX NEWS APP

“It was a complicated experience but it’s great to be here,” he added.