The existence of the Historical Office (today the Historical Archives of the Hungarian State Security) was due to two preconditions: first, it was created as a site for the documents which were produced by the state security police of the socialist regime between 1945 and 1990 and, second, it was only possible to create it following the change of the system in 1989/1990, which made it possible to move the documents to the archive relatively quickly. The idea of the establishment of an independent institution emerged at the beginning of 1990, connected to the so-called Duna-gate political scandal (which was about a case of wiretapping and which got its name from the American Watergate affair). This scandal made the transformation of the state security organs to national security organs faster, but nonetheless, the documents of the Office Division III of the Ministry of the Interior, which was responsible for the Duna-gate case, remained in the property of the Ministry of the Interior.
In 1990, Gábor Demszky and Péter Hack, who were members of the parliamentary opposition, submitted a bill to limit the political activity of the officers of the Office Division III. In 1994, the parliament modified the law about the lustration of certain persons in important public positions (they investigated whether they were members of the state security office or were in possession of information about it). The law forbade the examination of the documents for 30 years.
In 1994, the Constitutional Court considered whether or not the law met the criteria set by the Constitution. The Court established that the law had to respect the right of access to personal information and allowed individuals concerned to see the documents about themselves. Following this decision, the Minister of the Interior set up an expert committee to investigate the documents and suggested the transmission of the folders to the state archives. But this did not apply to the all of the materials. For some special files, the committee recommended establishing an independent institution. It was important that the committee listed more than the documents of the Office Division III. It included other important folders which were also preserved by the national security organs.
In 1996, the Parliament set up the Historical Office (Történeti Hivatal, TH), which was an archive despite its name. Because special rules had to be established concerning the preservation and treatment of these documents, it was necessary to set up an independent institution for this duty. In 1997, the President of the Republic appointed György Markó to serve as the first chairmen of the Historical Office. The transmission of the documents could begin. At this early time, the structure and rules of the institute were established. Scholarly researchers and private individuals began to visit the archive from 1 of September of that year. The TH soon became the most visited archive, taking into account the amount of materials it held.
The ordering of the documents meant a huge task for the associates of the archive. It had to develop a special database which was easy to search, because there were no guides or catalogues. This work began in 2000. Meanwhile, the issues of lustration, compensation, and historical research were separated, and the archive was responsible only for the latter. A 2001 law expanded the opportunities for academic research and qualified the TH as a specialized state archive which had to receive future documents of the working security services as well. However, the national security services could decide what kinds of folders they wanted to submit to the archive.
The Historical Archives of the Hungarian State Security (Állambiztonsági Szolgálatok Történeti Levéltára, ÁBTL), as the successor to the TH, was officially established in 2003 under the supervision of director general György Gyarmati. Between 2003 and 2005, more than 800 linear meters of materials were transferred to the ÁBTL. In 2017, the collection included 4,000 linear meters of documents. The register was created in 2003, and in 2009 an important preservation and digitalization project was launched.
In 2005, the ÁBTL law was modified again and more data became accessible to researchers and individuals affected, but the Constitutional Court nullified the law. Two years later, an expert committee was set up led by János Kenedi to formulate recommendations about the accessibility of documents which were held by the secret services. The committee suggested detaching the issue of the documents and that of the agents in this proposal. The latter one followed the method of lustration and made it more difficult to recognize information about the members of the agent network. Furthermore, the committee drew attention to the data which had been preserved on magnetic tapes by the officers of state security. The digitalization of the tapes has been completed, but researchers have not yet been granted access to them. The tapes were encrypted in 2015.