Brussels - EU leaders agreed early Friday to the principle of redistributing 40 000 asylum seekers across their bloc, but left the details to be hashed out later, amid hefty disagreement on whether member states should be obliged to take in the migrants.Conflicts and repression in Africa and the Middle East have driven thousands of people to travel to the European Union in search of protection or a better life.Many have lost their lives during attempts to cross the Mediterranean Sea, while the bulk of arrivals to the bloc have been concentrated in a handful of member states, stretching resources there. Less affected EU countries have been under pressure to show solidarity."Leaders agreed that 40 000 persons in need will be relocated from Greece and Italy to other states over the next two years," said EU President Donald Tusk, following late-night talks in Brussels.A further 20 000 refugees will be resettled from outside the EU, such as displaced Syrians, the leaders agreed. EU interior ministers will finalize the scheme by the end of July, Tusk said.But the summit discussion was bogged down by a fierce debate, after it became clear that several member states would oppose a mandatory scheme for the relocation of the 40,000 asylum seekers.Frustration"Passions are inflamed," one EU source said, as the talks dragged on into the early hours of Friday."If you do not agree with the 40 000, you do not deserve to be called Europe," Italian Prime Minister Matteo Renzi told his counterparts, according to another source. "Either there is solidarity, or please don't waste our time," he added.Sources said tensions were further exacerbated by a showdown between EU President Donald Tusk and European Commission President Jean-Claude Juncker over the decision-making process.But the two top officials later played down their differences, locking arms as they walked to a joint press conference. Frustration was still evident, however.Juncker said the leaders had reached a "modest" decision. "That we take hours to agree on the system to apply proves that Europe is not up to the ambitions that it declaims on every occasion," he added.It is now expected that interior ministers will proceed with a voluntary redistribution scheme."Every country must offer its own contribution, and then afterwards we will see whether the sum of contributions allows us to reach the objective, and if it is not the case, corrections will have to be made," said French President Francois Hollande.Tusk singled out circumstances in Hungary and Bulgaria, noting that they are also affected by "strong migratory flows," and said they would probably "be treated by us as specific cases when the time comes to distribute the pledges."While attention has focused on the plight of migrants crossing the Mediterranean, the two eastern European countries have faced an influx of people crossing their land borders to reach the EU.Hungary has the bloc's highest number of asylum requests, relative to population size, and Prime Minister Viktor Orban has been one of the strongest opponents of the proposed relocation scheme.Earlier this week, Hungary controversially announced that it has stopped accepting asylum seekers being sent back to its territory after moving on to other EU countries.EU rules stipulate that asylum claims must be processed in the member state where migrants first set foot.Following the summit debate, German Chancellor Angela Merkel described migration as the "biggest challenge" that the EU had faced during her time in office."I see a huge task approaching us, and here it will be decided whether Europe is up to the task," she said.