The European Union is coming under pressure to pare back its sweeping plan to cut greenhouse gas emissions amid fierce resistance from farmers as well as demands to boost military spending to counter Russia.

The EU has rolled out a raft of new regulations, taxes and investment programs in recent years that propelled the bloc to the forefront of the global fight to combat climate change. As European governments implement the measures, however, they are colliding with farmers , business groups and politicians who say the climate agenda is out of step with more urgent problems on the continent.

European leaders are soul-searching over how to increase defense and security as the war in Ukraine drags on and the prospect of a second Trump administration looms. Former President Donald Trump , the leading Republican candidate in the U.S. presidential contest, has spoken positively of Russian President Vladimir Putin and promised to broker an immediate peace deal. Anxieties are running high over the future of the North Atlantic Treaty Organization, the crux of European defense.

The war has also fueled higher energy prices across the continent—a flashpoint that triggered a wave of farmer protests in recent weeks as tractors poured onto roadways, snarling traffic in what farmers described as a siege of European capitals. To end the unrest, Berlin and Paris were forced to take the costly step of delaying planned reductions in diesel-fuel subsidies for farmers.

“We can’t remain in this situation,” said Arnaud Rousseau, head of France’s main farmers union. “Europe must not disarm itself in terms of food sovereignty.”

The European Commission, the bloc’s executive body, ran into resistance from member states to a proposal that sought to allocate 10 billion euros, or about $10.7 billion, in fresh money for strategic technologies, including those aimed at reducing greenhouse-gas emissions.

In negotiations with the European Parliament that ended with a political agreement early Wednesday morning, member states succeeded in limiting the new funding to €1.5 billion and keeping it focused exclusively on the defense industry. The agreement still needs formal approval by member states and parliament.

The pushback is a sign of how political winds are shifting across the continent. National governments are operating under tightened budgets amid fears they aren’t doing enough to address tensions over trade and immigration. Those anxieties are fueling support for far-right parties ahead of the European Parliament elections in June. They are also sending billions in military and economic aid to Ukraine as part of an effort to counter Russian expansionism.

French President Emmanuel Macron called for a regulatory pause last year, warning that a flood of climate-related red tape risked driving companies to instead invest in China and the U.S., where the Inflation Reduction Act is expected to unleash hundreds of billions in incentives and funding for clean energy. Macron has also been vocal about Europe’s need to develop an industrial policy that boosts military spending on homegrown defense contractors and plugs critical holes in the continent’s weapons supplies.

The EU has mostly plowed ahead in implementing its green agenda. The bloc’s €800 billion pandemic-recovery fund requires countries to allocate at least 37% of the spending to green measures and can be used until the end of 2026. Last year, the bloc enacted a first-of-its-kind plan to tax certain imports based on their greenhouse-gas emissions and a ban starting in 2035 on the sale of new diesel and gasoline cars.

On Tuesday, the European Commission recommended the bloc set a target to reduce net greenhouse-gas emissions by 90% by 2040 compared with 1990 levels.

Wave after wave of farmer protests, however, have forced Brussels to trim some of its agenda. The commission said Tuesday that it was withdrawing a proposed law aimed at sharply curbing the use of pesticides in farming after it was rejected by the European Parliament last year. The proposal “has become a symbol of polarization,” European Commission President Ursula von der Leyen said.

Last week, the commission agreed to delay the full implementation of a new rule requiring farmers to set aside at least 4% of their land for nonproductive purposes to continue to receive the bloc’s subsidies—a provision aimed at boosting biodiversity and soil quality.

The concession on farmland wasn’t enough to stop hundreds of farmers from converging outside the European Parliament in Brussels last week as EU leaders gathered for a summit nearby. The group burned tires and pulled down a statue near the parliament building, saying they were frustrated with increased regulation from Brussels and a decline in their income.

In Germany, farmer protests forced the government to announce it would stagger planned cuts to diesel-fuel subsidies. In France, Macron’s government has scrapped plans to partly raise the reduced tax rate it applies to diesel used in agriculture. The reduced rate costs €1.7 billion a year.

Macron has bent to protest over fuel taxes before. He decided to freeze a tax on the carbon content of various fuels to quell the 2018 yellow-vest movement. The tax was supposed to rise from €44.6 per ton of carbon dioxide to €86.20 in 2022 and then €100 in 2030.

he decision cost the French government €3.9 billion in 2018, rising to €15.4 billion in 2022.

– Matthew Dalton contributed to this article.

Write to Kim Mackrael at kim.mackrael@wsj.com and Stacy Meichtry at Stacy.Meichtry@wsj.com