Facebook (Nasdaq: FB), the No. 1 social networking site, said it would pay $10 million to charity to settle a California lawsuit in which five members claimed it has violated their privacy rights.

The Menlo Park, Calif., company was sued in a class-action case in federal court in San Jose, Calif., alleging Facebook used the members' likes in a feature called Sponsored Stories without their consent, contrary to California law.

U.S. District Court Judge Lucy Koh said state law had long recognized a right to protect one's name and likeness against others for their advantage. Facebook had no comment.

Facebook shares rose 89 cents to $30.90 in Monday trading.