SAN JOSE, Calif. (AP) — Google's attorneys say their long-running practice of electronically scanning the contents of people's Gmail accounts to help sell ads is legal, and are asking a federal judge to dismiss a lawsuit that seeks to stop the practice.

In court records filed in advance of a federal hearing scheduled for Thursday in San Jose, Google argues that "all users of email must necessarily expect that their emails will be subject to automated processing."

The class action lawsuit, filed in May, says Google "unlawfully opens up, reads, and acquires the content of people's private email messages" in violation of California's privacy laws and federal wiretapping statutes. The lawsuit notes that the company even scans messages sent to any of the 425 million active Gmail users from non-Gmail users who never agreed to the company's terms.

More From K2 Radio