European Union (EU) member states on Thursday agreed on common rules and procedures for returning illegal immigrants.
EU interior ministers, meeting in Luxembourg on Thursday, endorsed the so-called Return Directive, after years of wrangling.
"This is a real step forward," European Commission Vice President Jacques Barrot, who is in charge of justice, freedom and security affairs, told a press conference.
"This directive does provide for far greater certainty for those (illegal immigrants) involved," he said.
Slovenian Interior Minister Dragutin Mate, whose country holds the rotating EU presidency, expressed confidence that the European Parliament would approve the legislation on June 18.
The directive set a maximum period of detention of six months for people residing illegally in the EU.
Governments will be allowed to extend the maximum period for an additional 12 months, but only in "very specific circumstances," such as non-cooperation of the detainee.
At present, maximum detention periods vary in EU member states with nine countries having no limit.
Priority is given to voluntary return of illegal immigrants, said Barrot.
He said the directive also gives emphasis to the protection of children's rights, including their rights to education. He said the European Commission, the executive body of the EU, will keep an eye on the protection of children's rights.
The return directive also sets the maximum length of the entry ban after expulsion. The ban should not exceed five years unless a person "represents a serious threat to public policy, public security or to national security."
The directive provides for free legal assistance to illegal immigrants.