By Jonathan Stempel

(Reuters) - A federal judge has granted preliminary approval to Netflix Inc's $9 million settlement of class-action litigation accusing the video rental company of violating consumer privacy laws.

U.S. District Judge Edward Davila in San Jose, California, said the accord reached in February "compares favorably" to recent settlements of other consumer privacy cases, including with Google Inc and Facebook Inc.

The judge also certified a nationwide class of current and former Netflix subscribers estimated in the tens of millions, according to his order issued late Thursday.

Subscribers accused Netflix of violating the federal Video Privacy Protection Act of 1988 by keeping records of DVD and Internet videos they watched for at least two years after they canceled service, and also keeping credit card information.

They said Netflix used the data in marketing and advertising without consent, violating a legal requirement that it purge "personally identifiable information" within one year after it was no longer needed for the purpose for which it was collected.

Most people would feel "extremely uncomfortable" that the Los Gatos, California-based company could keep their viewing histories and credit card data for so long, the complaint said.

The settlement calls for Netflix to "decouple" subscribers' rental histories from other identification data once a year has passed since service was canceled. Money will also be used to educate consumers and regulators on privacy protection.

The case had been brought by former Netflix subscribers and Virginia residents Jeff Milans and Peter Comstock.

Netflix did not admit wrongdoing, and accounted for the settlement in its results for the fourth quarter of 2011.

A hearing to consider final approval is set for December 5.

The video privacy law was passed after Supreme Court nominee Robert Bork's video rental history was leaked in the press during his 1987 confirmation proceedings.

The case is In re: Netflix Privacy Litigation, U.S. District Court, Northern District of California, No. 11-00379.

(Reporting By Jonathan Stempel in New York; editing by John Wallace)