Facebook has agreed to give users more notice and control over how their profiles appear in "sponsored stories" to settle a class-action lawsuit.

The company also agreed to pay $10 million for the plaintiffs' attorney fees and give an additional $10 million to charities.

The plaintiffs had complained that Facebook had used their names and profiles in sponsored stories without their permission.

Sponsored stories are advertisements that appear on the side of the Facebook page that feature a user's friends. But the friends never agreed to endorse or support the advertised products.

ADVERTISEMENT

In the settlement, Facebook agreed to update its terms of service to notify users that their names and pictures can appear in advertisements. The company also agreed to create a tool to allow users to see and control which actions they take that will cause them to appear in the sponsored stories.

The company would have to obtain the consent of a parent or guardian to use the profiles of children under 18 in the ads.

But the settlement does not require Facebook to abandon the sponsored story ads.

An economist hired by the plaintiffs claimed that the sponsored stories are worth as much as $103.2 million for Facebook.

A spokesman for Facebook declined to comment on the case.