By Andrew Gray and Belén Carreño

At a summit in the Spanish city of Granada, leaders of the 27-nation union proclaimed that EU enlargement is an "investment in peace, security, stability and prosperity".

But they also said that both the EU and would-be members - which include Ukraine, Moldova and Western Balkan states - would need to make big changes to be ready for an enlarged union.

"Aspiring members need to step up their reform efforts, notably in the area of rule of law," they said in a statement.

Russia's invasion of Ukraine has propelled enlargement up the agenda of the EU. Its leaders say the conflict has shown the danger of countries being in contested "grey zones" rather than being firmly part of the EU political camp.

Even as it fights Russia's invasion, Ukraine has made EU membership talks one of its top priorities. It aims to get the green light from EU leaders at a summit in December.

Countries have to meet legal, economic and democratic standards to join the EU - a process that takes years. Officials say the EU will also have to overhaul its decision-making procedures and budget rules to take in new members.

Charles Michel, the president of the European Council of EU leaders, has proposed the bloc should be ready to expand by 2030, arguing setting such a target would encourage both the EU and candidate countries to step up their reform efforts.

"What's important is to stop procrastinating," Michel told a news conference at the end of the summit.

But other leaders have been cool on the idea, saying the focus should be on candidate countries meeting EU standards.

"The process is merit-based," said Ursula von der Leyen, president of the European Commission, the EU's executive. "There are clear rules, there are milestones that have to be achieved."

An internal EU report said that if current rules on farm subsidies, regional development and other spending applied to a union of 35 members, its budget would rise 21 percent, meaning an extra 256.8 billion euros ($271.9 billion) over seven years.

"Given that a bigger EU would need more resources, and that newly acceding Member States would become net beneficiaries of the EU budget, enlargement will have a far-reaching impact on the EU budget," said the report, prepared in July.

It said the accession of Ukraine alone could lead to an increase in spending of 186.3 billion euros ($197.23 billion) over seven years.

However, EU officials and diplomats say the budget setup would have to be overhauled before enlargement, so the report serves more as a illustration that change is needed rather than an accurate estimate of the cost of admitting new members.

EU aspirants include Albania, Bosnia and Herzegovina, Georgia, Montenegro, North Macedonia, Serbia, Turkey and Kosovo. Some are at various stages in membership talks while others aim to get the go-ahead in the coming months or years.

($1 = 0.9444 euros)

(Reporting by Andrew Gray, Belen Carreno and Inti Landauro; Editing by Kirsten Donovan)