Leaders of the European Union's 15 member states have agreed at a summit in Brussels on how to finance the bloc's expansion into Eastern Europe and the Mediterranean. The EU now has seven weeks to wrap up accession negotiations with 10 countries that hope to become members by 2004.

The agreement came after long hours of wrangling over just how much money the EU should offer the mostly poor, mostly agrarian, mostly ex-communist countries that want to become members.

Differences among EU countries over the bloc's costly farm subsidy program had threatened to derail, or at least delay, enlargement. But an agreement on Thursday between Germany, the main contributor to the farm budget, and France, the biggest beneficiary, to cap agricultural spending as of 2007 paved the way for an overall compromise on funding the union's expansion.

Danish Prime Minister Anders Fogh Rasmussen, who brokered the complex deal, could hardly contain his satisfaction.

"We have an agreement," he said. "This has indeed been a very successful summit. It represents a major step forward towards the historic decision on enlargement, which will be taken at the Copenhagen summit in December."

Mr. Rasmussen, whose country holds the EU's rotating presidency, wants to conclude negotiations with the candidate countries on thorny agricultural and budgetary issues in the weeks ahead, so that Denmark can crown its six-month stewardship of the EU with the bloc's most ambitious expansion ever.

The EU proposes to gradually increase farm subsidies to the applicant countries from 25 percent of what current members get to 100 percent over a 10-year period.

It would also give new members a total of $23 billion to develop their infrastructures during the first three years of their membership.

Many of the candidate countries have complained about the low starting level of the farm subsidies they would receive under the EU plan. They are expected to press hard for a better deal during the final phase of the accession negotiations that begin next week.

The EU says that, if the applicants were to receive bigger handouts, they would not be spurred into reforming their farm sector to make it more competitive with that of current EU members.

If the negotiations are successful and the enlargement process stays on track, the candidates, ranging from Cyprus to the Czech Republic and from Estonia to Slovenia, are expected to be formally invited to join the EU at the mid-December Copenhagen summit.