The judge accuses Volkswagen of "suspected participation in fraud, causing damage to a great number of people, of subsidy fraud and of damage to the environment", according to the charges which were brought on June 30 and published on Friday.
The Spanish investigation centres on suspected diesel engine manipulation, made possible by software which detected test conditions and temporarily cut emissions to pass tests on environmental norms, it said.
Among the Volkswagen brands in the spotlight is Spain's SEAT, taken over by Volkswagen in the 1980s, which runs two factories producing SEAT-branded cars, but also Audis.
Spanish prosecutors asked for permission to open an investigation in October after associations lodged complaints against Volkswagen.
Volkswagen last month agreed to a record payout in the US, pledging to buy back or fix vehicles that tricked pollution tests, and pay each owner up to $10,000.
The huge settlement, the biggest in a US air pollution probe, only partly resolves claims against the automaker, embroiled in a months-long scandal that has roiled the industry and tarnished the reputation of the company.
But nine months after the "Dieselgate" affair, when it emerged VW had installed emissions-cheating software into 11 million diesel engines worldwide, the former paragon of German industry is still nowhere near drawing a line under the affair.
Around the world, VW is facing regulatory probes and lawsuits filed by car owners who feel they have been duped and investors who are seeking compensation for the massive drop in the value of their shares.
Analysts have put the total expected cost to Volkswagen of the scandal at up to €30 billion ($33 billion).