A federal judge in Washington, D.C., on Friday blocked the Trump administration from enforcing a Pentagon policy that limited media access, ruling that key provisions unlawfully restrict press freedoms.

U.S. District Judge Paul Friedman determined the policy violated First and Fifth Amendment protections by failing to clearly define what journalistic conduct could lead to the denial or revocation of press credentials. The case was brought by The New York Times, which challenged the rules after some reporters declined to agree to the new requirements.

Friedman found the policy did not provide adequate notice to journalists and created the risk of arbitrary enforcement, writing that it could deter lawful reporting. He emphasized that a free press is essential to national security and public accountability, particularly during times of military conflict.

The Pentagon had argued the policy was a necessary safeguard to prevent the disclosure of sensitive national security information and ensure that individuals with access to military headquarters do not pose a risk.

Government attorneys described the rules as “common sense” protections, while critics argued they were designed to limit unfavorable coverage and discourage independent reporting.

In his ruling, Friedman ordered the Pentagon to reinstate the credentials of affected reporters and apply the decision broadly. He also denied a request from the government to delay enforcement of the ruling while an appeal is considered.

The Pentagon has not publicly responded to the decision.