Dec. 4 (UPI) -- The New York Times filed a lawsuit Thursday against the Department of Defense for violating the constitutional rights of journalists by adding restrictions on reporting about the military.

The suit accuses the Pentagon and Secretary Pete Hegseth of violating the First Amendment by creating the new restrictions on reporting. They "seek to restrict journalists' ability to do what journalists have always done -- ask questions of government employees and gather information to report stories that take the public beyond official pronouncements," the filing said.

The rules went into effect in October. They required reporters to sign a 21-page form that would restrict their activities, including requests for story tips and asking questions of Pentagon sources. Reporters who don't comply lose press passes.

Most news organizations with press credentials chose to give up those passes rather than sign the Pentagon's pledge.

The suit seeks a court order stopping the enforcement of the new rules and a declaration stating that the Pentagon's new policy targeting "protected newsgathering and speech and all actions implementing those provisions are unlawful and unconstitutional." It also seeks reinstatement of credentials for Times and other reporters.