In 1824–1826 on the castle hill, in the place of the destroyed royal castle, on the initiative of Stanisław Staszic and according to the design by John Stompf, a neo-Gothic building that exist until today was erected, intended for a criminal prison of the Congress Poland. Earlier, in the Middle Ages, the prison was located in the residential and defence tower – the keep.
During the partitions, participants of the fight for Polish independence (e.g. January insurgents) were detained in the castle. Also, in 1918–1939, apart from criminal prisoners, political prisoners were held here.
In 1939, after the German troops entered Lublin, the prison was taken over by the Security Police and Security Service of the Third Reich. It became the central prison of the Lublin District of the General Government (Polizeigefangenenhaus – Lublin). Political prisoners were imprisoned – people involved in the activities of the Polish Underground State, as well as regular criminals. It is estimated that over 40,000 people passed through the Lublin castle during the German occupation. Pre-war plans predicted that about 700 people can be held there at one time. In reality, over 3,000 people were detained in the castle at the same time.
During the entire period of German prison, executions took place in the castle. The first one was held on 13 November 1939, when ten residents of the villages of Siedliszcze and Majdanek Zahorodyński were shot. On 23 December 1939, ten prisoners of the castle were shot – merited citizens of Lublin – on the old Jewish cemetery. In the summer of 1940, around 500 prisoners were murdered during the AB-Aktion in the ravine in Rury Jezuickie. In 1940–1944 prisoners were also killed in executions of repressive character. On 22 July 1944, during the German evacuation from Lublin, in the last hours of the German prison, about 300 people were murdered. A so-called special court, issuing death sentences – Sondergericht – resided in the Lublin Castle.
Conditions in which prisoners had to exist, were inhumane. The cells were overcrowded, diseases were spreading, hunger prevailed. The prisoners was subjected to constant harassment from the German crew. Many convicted were murdered or lost their health during brutal interrogations-tortures carried out in “Under the clock” prison or the prison offices.
The help for the convicted was provided by the Polish prison guards, working in the castle already in the pre-war period, as well as several prisoners serving a function in the prison. Support came also from outside, from families or organisations, such as Rada Główna Opiekuńcza or the Polish Red Cross.
The end of World War II in Lublin did not end the tragedy. Already in September 1944, at the Lublin castle, the communist forces created a prison of security services (first Soviet – subordinated to NKVD and Smiersz, and then the Polish Ministry of Public Security); the castle became the main prison in Poland after the entrance of the Soviet troops.
The conditions were comparable to those that prevailed during the German occupation. The equipment was the same as in 1939–1944 (e.g. straw mattresses, but also torture tools). According to the memoirs of first prisoners, when they were arrested, the cells were still wet from the blood of the victims of the execution of 22 July. In April 1945, there were about 8,000 people in the castle, which significantly exceeded the highest numerical states from the war.
As during the period of the German prison, political prisoners (members of the Polish Underground State from World War II and continuing the struggle for independence after 1944; many of them were previously imprisoned by the Germans) were put in the castle together with the criminals. Some of them had to share cells with their torturers from the war. Research suggest that in 1944–1954, around 32,000–33,000 people passed through the Lublin Castle.
Brutal interrogations and executions were carried out. People were shot from the very beginning of the functioning of the communist prison (mostly in the cellars of a non-existent administrative building). 515 death sentences were issued against the prisoners of the castle, from which 180 people were killed in the prison. The last murdered, Edward Bukowski vel Obarski, was shot on 12 January 1954.
In February 1954, the liquidation of prison had started. In 1956, the building was transferred to cultural institutions. The history of the communist prison was concealed and censored until 1989.