The US government on Monday pledged to avoid issuing legal orders forcing journalists to reveal their sources, with only rare exceptions, reversing course after revelations of secret efforts to obtain information from the media, according to a report by AFP.

Releasing a statement, the agency said it would no longer use the "compulsory legal process", including subpoenas or warrants to obtain records or identify sources from journalists involved in newsgathering activities.

Also Read| As COVID cases rise, US governors refuse to put on mask mandate

The comes after reports of former president Donald Trump's Justice Department secretly obtaining phone records of journalists investigating his administration, inducing from CNN, the Washington Post and New York Times.

"A free and independent press is vital to the functioning of our democracy," said the new policy and it applies to reporters, publishers, third-party service providers and others involved in newsgathering, and to physical or digital documents as well as phone records.

The new policy was announced by Attorney General Merrick Garland, who called for "a review process to further explain, develop and codify the policy."

Also Read| Donald Trump lashes out at The Open Championship for not choosing his course

After assuming office, Trump administration sought records of journalists investigating Russian meddling in the 2016 election, while obtaining "gag orders" to keep that effort secret.

White House press secretary Jen Psaki said last month that the use of such orders in leak investigations "is not consistent with the president's policy direction.

According to the new policy, a journalist involved in an investigation, or suspected of being a foreign agent or member of a terrorist group, or in cases of "imminent" risk of death or bodily harm, can be ordered warrants to reveal the sources.

Also Read| Why is the White House waging war against social media platforms?

While the cases involving the Trump administration have drawn scrutiny recently, the policy change addresses a longstanding concern on press freedom and follows several cases where journalists have been threatened with jail for refusing to reveal sources.

"The attorney general has taken a necessary and momentous step to protect press freedom at a critical time," said Bruce Brown, executive director of the Reporters Committee for Freedom of the Press."

This historic new policy will ensure that journalists can do their job of informing the public without fear of federal government intrusion into their relationships with confidential sources."