By Paul Kirby
EU reporter, BBC News
The death of a young Malian immigrant near Paris sparked protests
After years of dispute, the EU has struck an accord on the detention and deportation of illegal immigrants.
"We have 10 to 12 million illegal persons in the EU... they are modern slaves," said German MEP Manfred Weber, who described the deal as a "big step".
He said there would be a six-month limit on detention for most people and a readmission agreement would have to be struck before they were sent home.
A final decision will now have to be made by MEPs and member states.
The deal was hammered out by the Slovenian Presidency of the EU, along with members of the European Commission and the parliament, but it is opposed by some MEPs.
The Socialist group has refused to give its consent to the accord, saying it objects to some of the terms.
EU IMMIGRANT DEAL
Seven-day period for "voluntary return"
Maximum six-month detention
Extra 12 months detention for "special cases"
Readmission agreement required with country of destination
Special facilities and safeguards for unaccompanied children
NGO access to detention facilities
Re-entry ban on involuntary deportees
"We have serious reservations about numerous aspects of the text, particularly on the duration for which immigrants can be held in detention centres," said French MEP Martine Roure, who took part in the talks in Strasbourg on Wednesday.
While France currently has a 30-day limit on detention, some EU countries such as Malta have an 18-month maximum and seven others, including the UK, have no limit.
Instead of the agreed six-month limit on detention with a possible further year for exceptional cases, the Socialists believe there should be a lower limit with an absolute maximum of six months.
But Dutch Liberal MEP Jeanine Hennis-Plasschaert told the BBC News website that while the agreement was not perfect, it was definitely a step forward.
"They (the Socialists) are acting politically irresponsibly and are completely immature," she said.
British Green MEP Jean Lambert said that the difficulty for some French MEPs was that while some countries would have to reduce their limit for immigrant detention, France would substantially increase its own.
Although the agreement was far better than if it had been left to governments to negotiate, she said the Greens would probably vote against it because of some of the provisions.
"If you're married to a British citizen but don't have the right to stay and are forced to leave, you can now find yourself banned for five years," she said.
The Socialists are also concerned about the treatment of unaccompanied children.
But Manfred Weber, the European Parliament's rapporteur on the return of illegal immigrants, said that social services would be responsible for the return of children rather than the usual authorities.
The plight of illegal immigrants has become a major issue in a number of EU countries. In Germany, campaigners complain that if an illegal immigrant goes to a hospital for treatment, doctors are required to inform the authorities.
That, says Mr Weber, leads to a situation in which many do not seek treatment.
In France earlier this month, Malian immigrant Baba Traore died after jumping into the River Marne while trying to escape from police east of Paris. He fled when he was asked for his identity documents.
Protesters took to the streets demanding rights for immigrants and the closure of detention centres.
The French government, which takes up the EU presidency in July, has made reaching a European immigration pact a priority.
Italy's incoming interior minister, Roberto Maroni, has called for "more rigour" against illegal immigration, speaking of a need for "more cleansing and more police".
Jeanine Hennis-Plasschaert said that the new agreement meant that there would now be an effective return policy across the EU which, until now, had not been in place.
"If you want to make a serious effort to come up with a comprehensive package on migration, you cannot ignore that we have to tackle the problems of illegal migration," he said.