Facebook suffered an early defeat in a D.C. court Friday, after a judge rejected the social-networking giant’s request to quash a case brought by the D.C. attorney general challenging the company’s privacy practices.

The ruling by D.C. Superior Court Judge Fern Flanagan Saddler paves the way for D.C. Attorney General Karl A. Racine to begin “obtaining all of the evidence proving that Facebook broke District law and did not follow its own policies to protect the privacy of more than 340,000 Facebook users who reside in the District,” he said in a statement Saturday.

Racine filed suit against Facebook in December, chiefly in response to the company’s entanglement with Cambridge Analytica, a political consultancy that improperly accessed social-site data on 87 million users. The incident combined with other privacy mishaps illustrated that Facebook had violated the District’s consumer-protection laws, the attorney general alleged, resulting in hundreds of thousands of local residents having their personal data mishandled.

Facebook has long contested Racine’s charges. Lawyers for the company argue that it never misled users about the privacy protections afforded to their personal data, and that news reports about the Cambridge Analytica incident amounted to sufficient disclosure to consumers about the mishap.

Over roughly an hour of oral arguments in March, Facebook also said that the District lacked jurisdiction over the tech giant, which is headquartered in California.

Absent a total dismissal, Facebook asked the judge to stay the matter pending a class-action case in another court — and a conclusion of the investigation by the Federal Trade Commission. The agency is expected to issue a fine into the billions of dollars, as well as other penalties against Facebook in the coming weeks.

But the attorney general persuaded the judge that the District had ample jurisdiction over Facebook, given local residents’ “repeated exchange of personal information through Facebook’s online social networking service,” Saddler wrote in her ruling. In doing so, she cited evidence submitted by the attorney general’s office showing Facebook had generated roughly $10 million in revenue in the final three months of 2018.

In rejecting Facebook’s request for a stay, Saddler also noted the class-action case involves complaints from users, not governments, while the FTC probe focuses on whether the tech giant violated a 2011 agreement with the government to improve its privacy practices.

The ruling marks an important early victory for the District, which at times has suggested it already has documents that could create major headaches for Facebook. In a March filing with the court, government lawyers referred to an “email chain that shows Facebook employees based in Washington D.C. . . . played a leading role in responding to how third-party applications sold consumer data to Cambridge Analytica.” Facebook has sought to keep such documents under seal.

On Saturday, Facebook stressed in a statement it does not believe “this lawsuit has any merit and will continue to defend ourselves vigorously.”

“Protecting people’s information and privacy is a top priority for us at Facebook, and we’ve taken a hard look at the information apps can use when you connect them to Facebook, as well as other data practices,” the company said. “We know we have more work to do.”