The company will appeal the ruling, a spokesman said.

After a five-year legal battle, a Madrid court found Volkswagen had engaged in anti-competitive business practices and ordered the carmaker to pay 3,000 euros in damages to each OCU member affected, the group said in a statement.

Volkswagen admitted in 2015 to using illegal software to cheat U.S. diesel engine tests, a scandal that has so far cost it more than $30 billion in vehicle refits, fines and provisions.

Nearly all U.S. owners of affected cars agreed to take part in a $25 billion settlement in 2016.

Last year Germany's highest court for civil disputes ruled Volkswagen had to pay compensation to owners of vehicles with rigged diesel engines in Germany.

($1 = 0.8247 euros)

(Reporting by Emma Pinedo, Editing by Nathan Allen and Mark Potter)