Image copyright Getty Images Image caption Pupils in California open new Chromebook laptop computers

The attorney general of the US state of New Mexico is suing Google, accusing the company of illegally collecting the personal data of school children.

The tech giant is alleged to have collected data on which websites pupils visited, passwords, videos watched, contact lists, and other information.

The data was allegedly gathered from Google's Chromebook laptops and G Suite for Education programme.

Google disputes the claim, with a spokesman calling it "factually wrong".

Google Chromebooks and the G Suite for Education - which includes Gmail, Calendar, Drive, Docs and others - are offered for free to more than 60% of students in New Mexico, according to the lawsuit.

Attorney General Hector Balderas said Google had failed to get parental consent from children under 13 and collected their data for commercial purposes, in violation of the Children's Online Privacy Protection Act.

Image copyright Getty Images

"Student safety should be the number one priority of any company providing services to our children, particularly in schools," Mr Balderas said in a statement. "Tracking student data without parental consent is not only illegal, it is dangerous."

"Google should be telling parents that they're going to stalk and track these children, and under the guise of education," he added, according to KRQU News in Albuquerque.

The lawsuit says that more than 80m teachers and students in the US use Google's education platform and tools.

Jose Castaneda, a spokesman for Google, said their programme "allows schools to control account access and requires that schools obtain parental consent when necessary".

"We do not use personal information from users in primary and secondary schools to target ads," his statement added.

The attorney general told US media that he had contacted school districts across the state to assure them that there was no imminent threat in continuing to use Google products.

Last year Google reached a $170m (£130m) settlement with the Federal Trade Commission over allegations that it illegally harvested personal data from children on YouTube.