BRUSSELS - European Union countries' ambassadors struck a deal on Friday on a landmark renewable energy law after the Commission agreed to possibly exempt certain ammonia plants from renewable fuel targets.

The Commission declaration ends a stalemate on passing the law after France and other states held up its approval for weeks to seek carve-outs for non-renewable fuels such as nuclear.

The law significantly increases the EU's renewable energy targets, requiring 42.5% of EU energy to be renewable by 2030, replacing the bloc's current 32% target for that date.

"Meeting the target...will, in certain cases, entail high adaptation costs of plants...This is the case of certain ammonia production plants," the declaration seen by Reuters showed.

"The Commission, on a case by case basis...will not take into account these existing plants while considering whether they have been fully amortised and when the final investment decision for retrofitting has been taken."

The move replaces an option discussed earlier this week that would see a loophole added into the law itself, which would have led to renegotiations with the European parliament. Countries also agreed to add a short recital to the text, which acknowledges the potential challenges of refitting ammonia plants.

It was not immediately clear whether parliament would approve the latest tweak to the deal.

Nuclear energy is low-carbon, but not renewable. France says Europe's shift to green energy will require hydrogen produced from both renewables and nuclear, and EU laws should support both

France and some eastern European countries with nuclear energy interests held up the renewable energy law for weeks over the issue - despite EU countries and lawmakers already agreeing a deal on the law in March which was supposed to be final.

Other countries including Denmark and Germany had opposed France's push, arguing that mixing nuclear into the renewable energy law could distract from the huge expansion of wind and solar needed to meet climate change goals.

"After months of deadlock, the Council decided to tighten up the EU Renewable Energy Directive. An investment boom across the EU will be the result," Germany's state secretary for energy and climate said on Twitter.

(Reporting by Julia Payne and Kate Abnett, Editing by Angus MacSwan)