BRUSSELS - Europe’s second-highest court gave clearance on Thursday to a Spanish tax lease scheme in the shipbuilding industry, annulling a decision by EU regulators two years ago that this gave a selective advantage to companies and so was illegal state aid. The ruling by the Luxembourg-based General Court underlines the hurdles facing the European Commission in its crackdown on corporate tax avoidance and national programmes that benefit only certain groups. The Spanish scheme involved financing ship construction through a structure with two intermediaries, and allowing shipping companies to get a rebate of 20 to 30 percent on the price of vessels built by Spanish shipyards. “The General Court annuls the Commission’s decision that the Spanish tax lease system is an illegal state aid. The measures concerned are not a selective advantage,” judges said. “The General Court also considered that the Commission did not give sufficient reasons for its finding that the measures at issue were likely to distort competition and affect trade between member states.” The EU executive will carefully examine the judgment and its potential implications, Commission spokeswoman Lucia Caudet told a news conference. The Spanish scheme came under scrutiny in 2006 after some companies complained to the Commission that they had lost out in shipbuilding contracts. The EU state aid enforcer ruled against the scheme in July 2013 and ordered Spain to claim back the aid from the beneficiaries. The Spanish government and two companies subsequently challenged the Commission’s decision. There are a total of 65 cases pending before the court against the EU finding. The Commission faces more legal battles after ordering the Dutch government in October to recover up to 30 million euros in back taxes from U.S. coffee chain Starbucks, and telling Luxembourg to do the same for Fiat Chrysler Automobiles . Luxembourg and the Netherlands have challenged the decisions.