L 105/54 Official Journal of the European Union 13.4.2006 DIRECTIVE 2006/24/EC OF THE EUROPEAN PARLIAMENT AND OF THE COUNCIL of 15 March 2006 on the retention of data generated or processed in connection with the provision of publicly available electronic communications services or of public communications networks and amending Directive 2002/58/EC THE EUROPEAN PARLIAMENT AND THE COUNCIL OF THE EURO- PEAN UNION, Having regard to the Treaty establishing the European Commu- nity, and in particular Article 95 thereof, Having regard to the proposal from the Commission, Having regard to the Opinion of the European Economic and Social Committee (1), Acting in accordance with the procedure laid down in Article 251 of the Treaty (?), Whereas: (1)  Directive 95/46/EC of the European Parliament and of the Council of 24 October 1995 on the protection of individu- als with regard to the processing of personal data and on the free movement of such data (3) requires Member States to protect the rights and freedoms of natural persons with regard to the processing of personal data, and in particular their right to privacy, in order to ensure the free flow of personal data in the Community. (2)  Directive 2002/58/EC of the European Parliament and of the Council of 12 July 2002 concerning the processing of personal data and the protection of privacy in the elec- tronic communications sector (Directive on privacy and electronic communications) (4) translates the principles set out in Directive 95/46/EC into specific rules for the elec- tronic communications sector. (3)  Articles 5, 6 and 9 of Directive 2002/58EC lay down the rules applicable to the processing by network and service providers of traffic and location data generated by using electronic communications services. Such data must be (') Opinion delivered on 19 January 2006 (not yet published in the Offi- cial Journal). (%) Opinion of the European Parliament of 14 December 2005 (not yet published in the Official Journal) and Council Decision of 21 February 2006. (®) OJL281,23.11.1995, p. 31. Directive as amended by Regulation (EC) No 1882/2003 (O] L 284, 31.10.2003, p. 1). (% OJL 201, 31.7.2002, p. 37. erased or made anonymous when no longer needed for the purpose of the transmission of a communication, except for the data necessary for billing or interconnection pay- ments. Subject to consent, certain data may also be pro- cessed for marketing purposes and the provision of value- added services. Article 15(1) of Directive 2002/58/EC sets out the condi- tions under which Member States may restrict the scope of the rights and obligations provided for in Article 5, Article 6, Article 8(1), (2), (3) and (4), and Article 9 of that Directive. Any such restrictions must be necessary, appro- priate and proportionate within a democratic society for specific public order purposes, i.e. to safeguard national security (i.e. State security), defence, public security or the prevention, investigation, detection and prosecution of criminal offences or of unauthorised use of the electronic communications systems. Several Member States have adopted legislation providing for the retention of data by service providers for the pre- vention, investigation, detection, and prosecution of crimi- nal offences. Those national provisions vary considerably. The legal and technical differences between national pro- visions concerning the retention of data for the purpose of prevention, investigation, detection and prosecution of criminal offences present obstacles to the internal market for electronic communications, since service providers are faced with different requirements regarding the types of traffic and location data to be retained and the conditions and periods of retention. The Conclusions of the Justice and Home Affairs Council of 19 December 2002 underline that, because of the sig- nificant growth in the possibilities afforded by electronic communications, data relating to the use of electronic communications are particularly important and therefore a valuable tool in the prevention, investigation, detection and prosecution of criminal offences, in particular organ- ised crime. The Declaration on Combating Terrorism adopted by the European Council on 25 March 2004 instructed the Coun- cil to examine measures for establishing rules on the reten- tion of communications traffic data by service providers.