Attorney General Merrick Garland reversed years of Department of Justice policy Monday and formally prohibited federal prosecutors from going after the records of reporters during leak investigations.

The new policy follows through on the pledge Garland made last month, when he said the DOJ would no longer try to seize journalists’ notes and other files while investigating government leaks. Garland’s decision looks to provide a resolution to a complex issue that has been a longtime problem for Justice Department prosecutors as they weigh the media’s First Amendment rights against government’s desire to protect classified information. Media organizations including newspapers and TV networks have pushed back against the Department regarding their reporters’ records and called for a change in policy.

Garland’s memo outlined the DOJ’s new approach. Here is one key section:

“The Department ofJustice will no longer use compulsory legal process for the purpose of obtaining information from or records of members of the news media acting within the scope of newsgathering activities…”

However, Garland’s directive also states that federal prosecutors can seize journalists’ records in certain situations. Those instances include if the reporters are suspected of working for agents of a foreign power or terrorist organizations. There is also an exception for situations with imminent risks, like kidnappings or crimes against children.

Garland was pressured to act on the matter after it was discovered that the DOJ under the Trump administration obtained records belonging to journalists at The Washington Post, CNN and The New York Times, as well as members of Congress, in an attempt to find out who leaked government secrets related to the Russia investigation and other national security matters.

Garland and other senior DOJ officials have met with representatives of news media organizations, to discuss the need for new department policies regarding reporters and the materials they gather in the process of investigating a story involving the government. Garland has also said he would support federal legislation that would grant further protection to journalists.