Meta Platforms will pay up to $18 billion over the next decade and introduce new restrictions on how teenagers use Facebook and Instagram under settlements reached with almost all the United States (US) states.

The agreements announced on Wednesday claims that Meta designed its platforms to keep children engaged, while misleading the public about risks to young users.

Under the settlement, teenagers will be limited to two hours of Facebook and Instagram use per day with their access blocked between midnight and 6am unless parents allow it.

Meta will also disable most push notifications for teenage users during school hours, from 8am to 3pm and strengthen measures aimed at preventing children from accessing age-restricted content.

The restrictions could become tighter if Snapchat, TikTok and YouTube agree to similar measures.

The settlements bring an end to a federal trial in which states alleged that Meta’s products harmed children. Four states California, Colorado, Kentucky and New Jersey had been expected to seek nearly $200 billion in civil penalties.

Meta denied wrongdoing as part of the settlement and said that it remained focused on making its platforms safer for teenagers.

“Ensuring teens have a safe and productive experience on our platforms is an absolute imperative for Meta,” the company said in a blog post. “We want to get this right for parents and teens.”

The company will make maximum payments of about $16.7 billion to 47 states, Washington D.C., Puerto Rico, American Samoa and the Northern Mariana Islands.

California could receive around $2.2 billion while New York could receive $1.1 billion. Texas reached a separate settlement with Meta worth more than $1 billion.

Around $12.7 billion of the settlement amount is guaranteed, while another $5 billion will depend on whether Snap, TikTok and YouTube introduce similar protections for children.

Some states plan to place the money in general accounts while others will use parts of the funds for children’s mental health programmes.

Meta will also pay $459 million to settle state privacy claims linked to the Cambridge Analytica scandal, in which personal data belonging to millions of Facebook users was collected without authorisation.

The settlement does not require Meta to end personalised recommendations or targeted advertising. It also does not cover some types of content that Meta researchers had previously identified as harmful to teenagers, including posts linked to concerns about body image.

US District Judge Yvonne Gonzalez Rogers approved the main settlement on Wednesday after overseeing the federal trial, which began on August 18.

At a hearing, Rogers described the agreement as “a good step forward” and told lawyers representing Meta and the states, “I am quite happy to not have to finish up this trial.”

The settlement could also serve as a model for thousands of other lawsuits against social media companies as governments increase efforts to limit children’s exposure to harmful online content.

Northwestern University law professor James Speta said that the agreement could change how teenagers use Facebook and Instagram.

“These restrictions will change the experience on Instagram and Facebook, and they are designed to reduce engagement,” he said.

Meta’s shares rose as much as 4.1 percent following the announcement before closing 1.1 percent higher.