Twitter has sued the U.S. government, alleging that the Justice Department’s restrictions on what the company can say publicly about the government’s national security requests for user data violate the firm’s First Amendment rights.

With its lawsuit, the San Francisco-based firm is seeking to go further than five other technology companies that earlier this year reached a settlement with the government on the permissible scope of disclosure at a time of heightened concern about the scale of government surveillance.

“It’s our belief that we are entitled under the First Amendment to respond to our users’ concerns and to the statements of U.S. government officials by providing information about the scope of U.S. government surveillance — including what types of legal process have not been received,” Ben Lee, a Twitter vice president, said in a post online. “We should be free to do this in a meaningful way, rather than in broad, inexact ranges.”

In a post-Edward Snowden world in which technology companies are striving to reassure customers about their commitment to privacy, Twitter is pressing for the ability to be more candid in its twice-a-year transparency reports than the government has been willing to permit.

Tech firms may now report the numbers of requests they receive from the government in broad bands — such as zero to 999, for instance. Twitter would like to be able to disclose the exact number of national-security-related orders received in any particular category — including zero, if that is the case.

Its complaint states that the company wants to report data in a way that reflects the “limited scope” of U.S. government surveillance of Twitter accounts. Unlike e-mail and phone communications, most Twitter posts are public. Unlike large e-mail providers, Twitter does not receive huge numbers of requests.

The Justice Department said it was reviewing Twitter’s complaint. In a statement, spokeswoman Emily Pierce said the government “worked collaboratively” with other technology companies to reach the settlement this year to allow them “to provide broad information on government requests while also protecting national security.”

Government officials also have said that as the FBI and National Security Agency are seeking to defend the country from real security threats, the more that the world knows about their sources and methods, the greater the risk of losing capabilities. They have pointed to efforts to be more transparent, including their release of thousands of pages of redacted court and government documents pertaining to NSA surveillance programs.

Twitter’s lawsuit was filed after months of effort to reach an out-of-court agreement, according to the complaint filed in U.S. District Court in California. In April, Twitter sent the government a draft copy of its July transparency report with a request that it be reviewed for publication. In September, FBI General Counsel James A. Baker told Twitter attorney Michael A. Sussmann, “We . . . have concluded that information contained in the report is classified and cannot be publicly released.” Since the FBI did not identify information in the draft report that Twitter could or could not publish, the firm effectively was blocked from releasing that report.

In its complaint, Twitter alleged that while the government has spoken extensively on the scope of its national security surveillance activities, it has at the same time gagged companies such as Twitter that wish to respond to the government’s statements or voice their own perspective as recipients of data requests. The government’s position, the complaint said, “forces Twitter either to engage in speech that has been preapproved by government officials or else to refrain from speaking altogether.”

Twitter also charged that its ability to respond to government statements about surveillance activities is unconstitutionally restricted by laws that bar a company’s disclosure of the number of requests it has received for national-security-related court orders and national security letters — administrative subpoenas for customer data.

Particularly vexing to the firm is the government’s position that not just the five firms who settled in January but all “similarly situated companies” are bound by the agreement, which bars disclosure even of the fact that a company has not received any such requests. “These restrictions constitute an unconstitutional prior restraint and content-based restriction on, and government viewpoint discrimination against, Twitter’s right to speak about information of national and global public concern,” the complaint said.

The January settlement was reached with Google, Yahoo, Microsoft, LinkedIn and Facebook. After those firms withdrew their legal challenge, Twitter attorneys met with the Justice Department and FBI and argued that the firm did not receive the same scale of surveillance requests as the five companies and should not be subject to the same limits. But government lawyers refused to amend the agreement to accommodate Twitter.

The firm is also seeking a ruling that a nondisclosure provision included in a national-security-letter statute, as well as the secrecy provisions in the Foreign Intelligence Surveillance Act, are unconstitutional. Twitter’s suit comes as the U.S. Court of Appeals for the 9th Circuit, which includes the Northern District of California, is due this week to consider the constitutionality of the gag provisions of the national-security-letters law.

The company made clear that the lawsuit is part of a broader push for surveillance reform through legislation, such as the USA Freedom Act pending in the Senate. Twitter belongs to a coalition of tech firms seeking changes such as greater transparency in reporting and stronger government oversight and accountability.