BRUSSELS — The 28 leaders of the European Union agreed early on Friday on targets for protecting the climate and generating greener power despite deep divisions among their nations over how to produce energy.

The main target that won approval was a pledge to slash emissions by at least 40 percent, compared with 1990 levels, by 2030.

The new target “will ensure that Europe will be an important player, will be an important party, in future binding commitments of an international climate agreement,” Angela Merkel, the German chancellor, said at an early-morning news conference.

The accord makes the European Union the first major global emitter to put its position on the table ahead of an important United Nations climate meeting in Paris at the end of 2015.