SAN FRANCISCO — California disclosed Wednesday that it has been quietly investigating Facebook for possible privacy violations for 18 months, and that state lawyers have sued the company for documents including CEO Mark Zuckerberg’s emails.

State Attorney General Xavier Becerra said that Facebook's responses to subpoenas from his office have been inadequate, and that he was asking a state court to enforce them.

“We have to uncover facts,” Becerra, a Democrat, said at a news conference. The only way to do that, he added, was to sue for answers from Facebook.

In response, Facebook released a statement saying it has been working with Becerra’s office.

“We have cooperated extensively with the State of California’s investigation. To date we have provided thousands of pages of written responses and hundreds of thousands of documents,” Will Castleberry, Facebook’s vice president of state and local policy, said in the statement.

Facebook agreed in July to pay $5 billion to end a Federal Trade Commission investigation of its privacy practices, a settlement that lawmakers and consumer advocates blasted for not going far enough to hold the company accountable.

The social media giant has been embroiled in a data-harvesting scandal since the disclosure in April last year that user data for 87 million people had been shared without their knowledge with Cambridge Analytica, a data analysis firm that worked with President Donald Trump’s 2016 campaign.

California’s investigation began last year during the Cambridge Analytica scandal, Becerra said.

“We have since spring of 2018 been looking into allegations that Facebook violated California law by among other things deceiving users and misrepresenting its privacy practices,” he said. “Those are serious allegations.”

During the investigation, he said, Facebook “failed to provide or even search for responsive documents among the emails of the company’s chief executive, Mark Zuckerberg, and its chief operating officer, Sheryl Sandberg.”

Becerra declined to say whether any other states were part of California’s probe. Separately, 47 state attorneys general are investigating Facebook for possible antitrust violations.