THE section on justice and home affairs sets out "to maintain and develop the Union as an area of freedom, security and justice, in which the free movement of persons is assured in conjunction with appropriate measures with respect to external border controls, immigration, asylum and the prevention and combating of crime".
Without a doubt the most complex area of the negotiations, the area of justice and home affairs (JHA) has been until now part of the "Third Pillar" or dealt with separately outside the EU in the Schengen Treaty.
Essentially, the latter concerns free movement of citizens between the member states without border controls, while Third Pillar discussions on free movement involved those coming from outside the EU. The Third Pillar's judicial and police co-operation in the struggle against crime is also substantially enhanced.
The problem was one of reconciling four aspirations - the British and Irish wish to keep their common travel area, Britain's determination to retain its own border controls, and the determination of 13 others to move to abolish all internal frontiers and incorporate Schengen in the EU treaty.
And there was also a desire on the part of all except Britain and Denmark to extend the role of the EU institutions in this field.
Under the agreed formula the Council of Ministers, acting on the basis of the unanimity of the 13 continental countries, will be required by 2004 to agree on measures aimed at the free movement of people throughout the EU by common rules and flanking measures governing external border controls, asylum, immigration and the rights of third country nationals.
These include standardisation of visas, rules for checks on external frontiers of the EU, a common list of those requiring visas, rules to determine who should consider asylum applications, minimum standards for treatment of asylum-seekers, rules governing immigration, and minimum standards for treatment of refugees.
There is an aspiration to sharing the burden of coping with an influx of refugees or displaced persons. At the end of five years the heads of government may decide by unanimity whether they wish in the future that such decisions be taken by qualified majority vote.
But the issues are brought from the so-called Third Pillar to the First, giving the Commission a right to initiate proposals, the Parliament some oversight, and the European Court of Justice the right to interpret provisions on the request of a national court.
Ireland's position on border controls, like Britain's, and their common travel area, are secured in a protocol and declaration.
Ireland distances itself from the British position with a special declaration pledging to take part in flanking measures, such as police co-operation, "to the maximum possible extent". It also notes that Ireland's non-participation in the full arrangements is due only to its wish to preserve the common travel area with Britain.
The final version of the treaty also provides much-simplified mechanisms for Irish or British options to those Schengen-associated policies or projects they do want to participate in as a new project is developed for the first time they will simply have to state their wish to participate. If the project is under way, their participation can be blocked only by a qualified majority vote.
The treaty will commit member states to improving police, judicial customs, and administrative co-operation between member states and make their legal systems more compatible systems for serving court documents across the EU, co-operation in taking evidence, and recognition and enforcement of each other's court rulings.
Legal systems are to be "approximated" rather than harmonised, leaving the precise shape of national legislation to national authorities.
Europol's role is to be enhanced to allow it to carry out special operations and develop new areas of expertise and reinforce liaison with national forces.
The treaty will "facilitate" extradition between member states, although it will not go as far as the Spanish would like in providing for automatic extradition at the request of a member state.
The European Court gets the right to ensure that legislative acts of the EU are compatible with human rights, and the treaty makes provision for the suspension of some of the membership rights of states by the European Council if it deems that a state has been involved in "a serious and persistent breach" of such principles.
A vote to do so would require unanimity of all except the affected state, and the assent of MEPs, while restoring full membership can be done by qualified majority.
The measure is seen largely as a precautionary move ahead of enlargement to include states whose democratic credentials may yet have to be fully established.
The EU is empowered to take action to combat discrimination "based on sex, racial or ethnic origin, religion and belief, age or sexual orientation", and required to promote equality between men and women in its programmes.
The European Court will have the right to interpret conventions at the request of a national court - but may not rule on "the validity or proportionality of operations carried out by the police or other law enforcement agencies of a member state or the exercise of the responsibilities incumbent on member states with regard to the maintenance of law and order and the safeguarding of internal security".