By Sarah E. Needleman

A federal court dismissed a New Mexico lawsuit alleging that Alphabet Inc.'s Google knowingly spied on students and their families through its suite of cloud-based products for schools.

U.S. District Judge Nancy D. Freudenthal last week ruled that the internet company didn't violate the Children's Online Privacy Protection Act, or COPPA, in relying on schools to review or limit what data its education platform collects and uses on behalf of students' parents.

While the state argued that Google buried the option in its settings for students and parents to opt out of allowing the company to read their data, "there is no requirement that the notice be written in terms understandable by a child under the age of 13," the judge wrote in her ruling.

Judge Freudenthal also noted that recently published guidance from the Federal Trade Commission also says schools can be intermediaries for parental notice and consent.

"We strongly disagree with the Court's ruling and will continue to litigate to protect child privacy rights," said New Mexico Attorney General Hector Balderas in a statement. "I have no doubt that a company that has already paid millions of dollars in fines to the federal government is not putting the privacy and security of children first."

The judge said any amended complaint would have to be filed by Oct. 13.

A Google spokesman said the company is pleased with the case outcome. "We are committed to partnering with schools to protect students' privacy," he said.

The suit, filed in February in Albuquerque, was a fresh challenge to Google's data-collection practices amid broader criticism by lawmakers, regulators and others of the company's efforts to protect user privacy, particularly regarding children. Federal law prohibits companies from collecting data on children under 13 without parental consent.

A year ago, YouTube, also owned by Alphabet, agreed to pay a $170 million fine to the FTC, without admitting wrongdoing, to settle allegations that it tracked internet activity for children to sell ads for products.

In a June company blog post, Google said it doesn't use any personal information from G Suite for Education users in K-12 schools to target ads.

Google dominates the U.S. school-device market with an estimated 63% share as of the second quarter through the distribution of its low-cost Chromebooks and Chromebook tablets, according to estimates from Futuresource Consulting Ltd. The budget laptops house the Google for Education platform, a suite of free tools for schools that include Google-powered email, cloud storage and calendars. They also introduce students to some of the company's other products starting as early as kindergarten, including its Chrome operating system and web browser.

In pursuing its case against Google, New Mexico said it worked with an analytics team that conducted forensic testing to show student data being unlawfully transmitted. While students and parents can opt out of allowing Google to read the data, the lawsuit alleged that option is buried in settings where parents likely never see it.

At the time, Mr. Balderas said student safety should be "the number-one priority of any company providing services to our children, particularly in schools."

--Yoree Koh contributed to this article.

Write to Sarah E. Needleman at sarah.needleman@wsj.com