A federal judge has ruled that Twitter can’t reveal surveillance requests it received from the US government, putting an end to legal battle that lasted six years, Reuters reported. Judge Yvonne Gonzalez Rogers wrote in her order that Twitter’s request to reveal part of its Draft Transparency Report “would be likely to lead to grave or imminent harm to the national security.”

Twitter sued the Justice Department in 2014, arguing that its free speech rights were being violated since it was prohibited from revealing the number of government surveillance requests it receives.

While several other companies, including Google and Facebook, reached an agreement with the US government earlier in 2014 to break out national security requests in broad numbers, Twitter said that measure was insufficient. “Allowing Twitter, or any other similarly situated company, to only disclose national security requests within an overly broad range seriously undermines the objective of transparency,” Twitter’s policy director Jeremy Kessel wrote at the time.

In a statement emailed to The Verge on Saturday, a Twitter spokesperson said the company was “disappointed” with the court’s decision but that it would continue to fight for transparency, adding that “freedom of expression is the cornerstone of why we exist.”

“We believe it is vital that the public see the demands we receive, and how we work to strike a balance between respecting local law, supporting people’s ability to Tweet, and protecting people from harm,” the spokesperson said.

UPDATE April 18th 10:27AM ET: Added comment from Twitter