By Dan Levine and Sarah McBride

SAN FRANCISCO (Reuters) - Facebook Inc has agreed to pay $10 million to charity to settle a lawsuit that accused the site of violating users' rights to control the use of their own names, photographs and likenesses, according to court documents made public over the weekend.

The lawsuit, brought by five Facebook members, alleged the social networking site violated California law by publicizing users' "likes" of certain advertisers on its "Sponsored Stories" feature without paying them or giving them a way to opt out, the documents said.

A "Sponsored Story" is an advertisement that appears on a member's Facebook page and generally consists of another friend's name, profile picture and an assertion that the person "likes" the advertiser.

The settlement was reached last month but made public this weekend. Facebook declined to comment on Saturday.

The proposed class-action lawsuit, filed in federal court in San Jose, California, could have included nearly one of every three Americans, with billions of dollars in damages, according to previous court documents.

In the lawsuit, Facebook Chief Executive Mark Zuckerberg was quoted as saying that a trusted referral was the "Holy Grail" of advertising.

In addition, the lawsuit cited comments from Facebook chief operating officer Sheryl Sandberg, saying that the value of a "Sponsored Story" advertisement was at least twice and up to three times the value of a standard Facebook.com ad without a friend endorsement.

U.S. District Judge Lucy Koh said the plaintiffs had shown economic injury could occur through Facebook's use of their names, photographs and likenesses.

"California has long recognized a right to protect one's name and likeness against appropriation by others for their advantage," Koh wrote.

The settlement arrangement is known as a cy-pres settlement, meaning the settlement funds can go to charity.

The case in U.S. District Court, Northern District of California is Angel Fraley et al., individually and on behalf of all others similarly situated vs. Facebook Inc., 11-cv-1726.

Facebook shares closed at $30.01 on Friday, down 21 percent since the company's initial public offering last month.

(Editing by Jackie Frank)