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 have asked a federal judge to dismiss a lawsuit that seeks to stop the practice.

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

The lawsuit, filed on behalf of 10 individuals, is expected to be certified as a class action and is widely seen as a precedent-setting case for other email providers.

The plaintiffs say 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.

"This company reads, on a daily basis, every email that's submitted, and when I say read, I mean looking at every word to determine meaning," said Texas attorney Sean Rommel, who is co-counsel suing Google.

And Rommel said "the data that's being amassed by this company" could be used for more than just targeting advertising, although the parts of the lawsuit discussing what more Google might be doing with private information is currently under seal.

"The injury is two-fold: the privacy invasion and the loss of property. Google is taking people's property because they can get it for free as opposed to paying for it," said Rommel.

Judge Lucy Koh said she would consider Google's request to terminate the case, but she said she is also interested in scheduling a trial for next year, indicating she is unlikely to dismiss. She did not say when she would decide.

Scrutinizing Google's privacy policy, Koh noted that it doesn't specify that Google is scanning Gmail when it describes the type of information it's collecting.

"Why wouldn't you just say 'the content of your emails?'" she asked.

Google attorney Whitty Somvichian said that the company is attempting to have a single privacy policy for all of its services, meaning it didn't separately reference every single product.

But he said it's "inconceivable" that someone using a Gmail account would not be aware that the information in their email would be known to Google.

Google has repeatedly described how it targets its advertising based on words that show up in Gmail messages. For example, the company says if someone has received a lot of messages about photography or cameras then it might display an advertisement from a local camera store. Google says the process is fully automated, "and no humans read your email..."

"Users, while they're using their Google Gmail account, have given Google the ability to use the emails they send and receive for providing that service," Somvichian said in court. "They have not assumed the risk that Google will disclose their information and they fully retain the right to delete their emails."

Privacy advocates have long questioned the practice, and were closely watching the lawsuit.

"In this Gmail case Google is trying to argue that its technology is exempt from privacy and wiretap laws. If they win, it will set a horrible precedent that they will try to apply to other Google technologies greatly threatening consumers' privacy rights," Consumer Watchdog Privacy Project director John Simpson said on Thursday.