Directive 2006/24/EC of the European Parliament and of the Council, of 15 March 2006, on data retention, established the obligation (to telecommunications operators) to retain electronic communications data (fixed network telephony, mobile telephony or Internet) for the purpose of the investigation, detection and prosecution of serious crime. The ECJ, however, destabilised the bases of said regulation with the case Digital Rights Ireland and Seitlinger and Others (2014), as well as with the case Tele2 Sverige and Watson and Others (2016), in which it declared that data retention in the terms of the 2006 Directive was contrary to EU law. With respect to Spanish law, it was Law 25/2007, of 18 October, on data retention relating to electronic communications and the public communications networks, which made the transposition of the Data Retention Directive (2006), but in the light of the ECJ doctrine, its application could be questioned (as well as the other national legislations that transposed it). However, far from being a harmonious matter, very different positions have been maintained by the Supreme Court of Spain in its decisions and in relation to the doctrine. Furthermore, to this may be added the subsequent pronouncements of the ECJ, particularly the case of La Quadrature du Net and Others versus Premier Ministre and Others (2020), in which the ECJ has laid the foundations for data retention in the field of electronic communications or telecommunications.