The Commission stipulated in 2014 that the carmaker should receive no more than 17 million euros ($18.9 million) to expand production of two models of electric and hybrid passenger cars in Leipzig, a project expected to create 800 jobs.
Germany had originally planned to grant 45 million euros ($50.1 million) towards the project, but the Commission ruled any amount exceeding 17 million euros was incompatible with internal market rules.
BMW challenged the decision, arguing that the Commission had made errors in calculating the cost of the project. It lost an initial case before the General Court of the European Union, the second highest EU court, in September 2017.
BMW subsequently appealed, but the European Court of Justice rejected the appeal on Monday.