Facebook is under criminal investigation over data-sharing deals it signed with Apple, Amazon, and other major tech companies, reports the New York Times.

The partnerships, first reported in June, gave those outside companies to data including friends lists, contact information, and even private messages — and not always with the user's consent.

Most of those partnerships have ended over the last two years.

Facebook tells the Times that it is cooperating with investigators.

Federal prosecutors have opened a criminal investigation into data-sharing deals struck between Facebook and makers of mobile computing devices like smartphones and tablets, reports the New York Times.

Under the terms of those deals, which the Times reported about in June, Facebook allowed device makers including Apple, Amazon, and Microsoft to access personal user data, including friend lists, contact information, and sometimes even private messages — and not always with the user's consent, the report alleged.

According to the New York Times report, a grand jury in New York has already subpoenaed information on these types of deals from at least two smartphone and other device manufacturers involved.

“We are cooperating with investigators and take those probes seriously,” a Facebook spokesperson told Business Insider. “We’ve provided public testimony, answered questions and pledged that we will continue to do so.”

News of the criminal investigation is the latest in a series of controversies surrounding the 2-billion member social networking giant. Facebook has been struggling to rehabilitate its public image amid revelations that it allowed Cambridge Analytica to improperly access the personal data of many of its users and the growing evidence of how its social network has been used to spread misinformation during the 2016 US Presidential elections.

Facebook's stock declined 1.5% in after hours trading on Wednesday.

As if to underscore the company's challenges, Facebook's social network suffered one of the worst technical outages in its history on Wednesday, leaving users and advertisers unable to access the site for much of the day.

Focus of the criminal inquiry is unknown

Facebook is already facing the prospect of multi-billion dollar fines to settle privacy investigations by the Federal Trade Commission and other agencies. But a criminal investigation would raise the stakes significantly.

Wednesday's Times report, which cited anonymous sources, said it was not clear what exactly the grand jury inquiry overseen by federal prosecutors is focused on, or when it began.

In December, following the Times report, Facebook said in a blog entry that these partnerships were necessary to enable certain social features in outside apps, like logging into a Facebook account from a Windows phone, or sharing what Spotify song you were listening to via Facebook Messenger.

"To be clear: none of these partnerships or features gave companies access to information without people’s permission, nor did they violate our 2012 settlement with the FTC," wrote Facebook in that blog post.

Most of those partnerships have ended over the last several years.

The United States Department of Justice declined to comment on the report.