* ECJ Advocate General argues against Spanish fuel tax
* "Health cent" on fuel meant to finance healthcare spending
* Spain may be liable for 13 billion euros in compensation
MADRID, Oct 24 (Reuters) - An adviser to the European Union's top court has recommended it should rule that a Spanish fuel tax breaches EU law, potentially obliging Spain to pay billions of euros in compensation to fuel consumers.
Advocate General Nils Wahl, an adviser to the European Court of Justice, said in a written opinion on Thursday that the Spanish tax is illegal because it does not meet the conditions the EU sets on the levy of additional indirect taxes.
While the advocate general's opinion is not binding, the European Court of Justice follows most such recommendations.
He also rejected Spain's argument that the country would not need to repay some 13 billion euros ($18 billion) levied in the past. EU state aid regulators could insist on repayment if judges back them in the coming months.
Spain created a "health cent" tax on the sale of hydrocarbons in 2003 to generate revenues to help finance healthcare spending by its autonomous regions.
But the adviser said the tax overlapped with a separate tax on mineral oils and did not meet conditions such as specifically aiming to reduce hydrocarbon consumption or ensuring that the revenues are not just lumped into Spain's regular government budget.
"Spain appears to have knowingly taken the risk of going forward with the legislation in question and, as a result, that legislation has been applied for many years to the detriment of the end-user and the internal market," Wahl said in his opinion.
Spain's finance ministry said in a statement on Thursday that it would respect the EU court's eventual ruling but noted that it folded the "health cent" tax into a wider hydrocarbon tax last year in anticipation of the case.
If negative, the ruling could be a costly challenge for Spain's local and central governments, which are struggling with heavy deficits, though it is not clear how many claimants could come forward with compensation demands.
The ECJ case was brought by Catalan haulage company Transportes Jordi Besora S.L., which is seeking compensation on 45,632 euros of taxes levied between 2005 and 2008.
Spanish law limits claims to four years.