The deal ends a near three-year struggle over the future of the EU Common Agricultural Policy, which will suck up around a third of the EU's 2021-2027 budget, spending 387 billion euros on payments to farmers and support for rural development.

Representatives from EU member states and European Parliament clinched the agreement, which aims to shift money from intensive farming practices to protecting nature, and rein in the 10% of EU greenhouse gases emitted by agriculture.

The new CAP rules apply from 2023 and do not cover Britain following its exit from the EU.

"On some points we may have wished for a different outcome but overall I think we can be content with the agreement we have achieved," EU agriculture commissioner Janusz Wojciechowski said in a tweet.

Campaigners and some lawmakers said the deal failed to align farming with EU goals to fight climate change, warning that many of the green measures were weak or made it optional for member states to require farmers to shift to environmentally friendly methods.

The deal would require countries to spend 20% of payments to farmers from 2023-2024, rising to 25% of payments between 2025-2027, on "eco-schemes" that protect the environment, according to a draft agreement seen by Reuters. The final agreement was not published.

Examples could include restoring wetlands to absorb CO2, or organic farming, although the rules did not define what would count as an eco-scheme.

Any funds below those limits that are not spent on eco-schemes must be spent on green measures in other areas instead.

Other agreements included rules requiring EU countries to redistribute at least 10% of CAP funds to smaller farms. Countries could dodge this requirement if they use other methods to distribute the funds fairly.

All farmers' payments would be tied to complying with environmental rules, such as setting aside 4% of arable land for areas where nature can thrive, or rotating crops annually to boost soil health.

EU auditors this week said the current CAP was failing to reduce emissions. EU agriculture emissions, half of which come from livestock, have not decreased since 2010.

European Parliament and EU member states must both formally approve the agreement.

(Reporting by Kate Abnett; Editing by Toby Chopra)

By Kate Abnett