A Massachusetts judge has ordered Facebook to turn over data about thousands of apps that may have mishandled its users’ personal information, rejecting the tech giant’s earlier attempts to withhold the key details from state investigators.

The decision amounted to a significant early victory for Maura Healey, the Democratic attorney general of Massachusetts, who said in a statement Friday that Facebook users — and local watchdogs — “have a right to know” whether the company broke the law and violated people’s privacy.

Facebook, however, signaled the fight may not be over, marking its latest effort to battle back state regulators who have intensified their scrutiny of the tech giant.

“We are disappointed that the Massachusetts Attorney General and the Court didn’t fully consider our arguments on well-established law," spokesman Andy Stone said in a statement, adding: "We are reviewing our options, including appeal.”

Massachusetts revealed it was probing Facebook over its data-collection practices in September, an investigation that stemmed from the company’s entanglement with Cambridge Analytica. That privacy scandal already has resulted in a record-breaking, $5 billion federal fine for Facebook.

The court dispute centered on Facebook’s admission last year that it had suspended “tens of thousands” of apps for possible privacy violations. Facebook discovered the app issues as a result of an internal audit of its third-party developers, but it declined to share — with the public or with Massachusetts officials — exactly who it had suspended or many details about their potential wrongdoings.

Healey and her aides argued the data was critical, potentially showing that thousands of apps, some with large numbers of users, presented an elevated risk of privacy violations or behaved in a way that “may suggest data misuse,” her office said at the time. Facebook, however, fought to keep the evidence to itself, arguing it should be shielded from investigators.

After months of wrangling, the attorney general’s office took the issue before a Suffolk Superior Court judge, who ruled Friday that Facebook must surrender the information. Facebook now has 90 days to comply with the state’s request.

“We are pleased that the Court ordered Facebook to tell our office which other app developers may have engaged in conduct like Cambridge Analytica,” Healey said in a statement.

Facebook, for its part, has fought aggressively against states that have probed its privacy practices in the months after the Federal Trade Commission settled with the company. In California, for example, Facebook’s refusal to turn over key documents prompted Attorney General Xavier Becerra (D) to take the company to court in November.