During the final months before liberation, the camp's commander Franz Ziereis prepared for its defence against a possible Soviet offensive. Most of the inmates of German and Austrian nationality "volunteered" for the SS-Freiwillige Häftlingsdivision, an SS unit composed mostly of former concentration camp inmates and headed by Oskar Dirlewanger. The remaining prisoners were rushed to build a line of granite anti-tank obstacles to the east of Mauthausen. The inmates unable to cope with the hard labour and malnutrition were exterminated in large numbers to free space for newly-arrived evacuation transports from other camps, including most of the sub-camps of Mauthausen-Gusen located in eastern Austria. In the final months of the war, the main source of calories, that is the parcels of food sent through the International Red Cross, stopped and food rations became catastrophically low. The prisoners transferred to the "Hospital Sub-camp" received one piece of bread per 20 inmates and roughly half a litre of weed soup a day. This made some of the prisoners, previously engaged in various types of resistance activity, begin to prepare plans to defend the camp in case of an SS attempt to exterminate all the remaining inmates. It is not known why the prisoners of Gusen I and II were not exterminated en-masse, despite direct orders from Heinrich Himmler; Ziereis' plan assumed rushing all the prisoners into the tunnels of the underground factories of Kellerbau and blowing up the entrances. The plan was known to one of the Polish resistance organizations which started an ambitious plan of gathering tools necessary to dig air vents in the entrances.
On 28 April, under cover of a fictional air-raid alarm, some 22,000 prisoners of Gusen were rushed into the tunnels. However, after several hours in the tunnels all of the prisoners were allowed to return to the camp. Stanisław Dobosiewicz, the author of a monumental monograph of the Mauthausen-Gusen complex explains that one of the possible causes of the failure of the German plan was that the Polish prisoners managed to cut the fuse wires. Ziereis himself stated in his testimony written on May 25 that it was his wife who convinced him not to follow the order from above. Although the plan was abandoned, the prisoners feared that the SS might want to massacre the prisoners by other means. Because of that the Polish, Soviet and French prisoners prepared a plan for an assault on the barracks of the SS guards in order to seize the arms necessary to put up a fight. A similar plan was also devised by the Spanish inmates.
On 3 May the SS and other guards started to prepare for evacuation of the camp. The following day, the guards of Mauthausen were replaced with unarmed Volkssturm soldiers and an improvised unit formed of elderly police officers and fire fighters evacuated from Vienna. The police officer in charge of the unit accepted the "inmate self-government" as the camp's highest authority and Martin Gerken, until then the highest-ranking kapo prisoner in the Gusen's administration (in the rank of Lagerälteste, or the Camp's Elder), became the new de facto commander. He attempted to create an International Prisoner Committee that would become a provisional governing body of the camp until it was liberated by one of the approaching armies, but he was openly accused of co-operation with the SS and the plan failed. All work in the sub-camps of Mauthausen stopped and the inmates focused on preparations for their liberation - or defence of the camps against a possible assault by the SS divisions concentrated in the area. The remnants of several German divisions indeed assaulted the Mauthausen sub-camp, but were repelled by the prisoners who took over the camp. Out of all the main sub-camps of Mauthausen-Gusen only Gusen III was to be evacuated. On 1 May the inmates were rushed on a death march towards Sankt Georgen, but were ordered to return to the camp after several hours. The operation was repeated the following day, but called off soon afterwards. The following day, the SS guards deserted the camp, leaving the prisoners to their fate.
The survivors of Ebensee sub-camp shortly after their liberation
The camps of Mauthausen-Gusen were the last to be liberated during the World War II. On 5 May 1945 the camp at Mauthausen was approached by soldiers of the 41st Recon Squad of the US 11th Armored Division, 3rd US Army. The reconnaissance squad was led by S/SGT Albert J. Kosiek. His troop disarmed the policemen and left the camp. By the time of its liberation, most of the SS-men of Mauthausen had already fled; however, some 30 who were left were killed by the prisoners; a similar number were killed in Gusen II. By 6 May all the remaining sub-camps of the Mauthausen-Gusen camp complex, with the exception of the two camps in the Loibl Pass, were also liberated by American forces.
Among the inmates liberated from the camp was Lieutenant Jack Taylor, an officer of the Office of Strategic Services. He had managed to survive with the help of several prisoners and was later a key witness at the Mauthausen-Gusen camp trials carried out by the Dachau International Military Tribunal. Another of the camp's survivors was Simon Wiesenthal, an engineer who spent the rest of his life hunting Nazi war criminals. Future Congressional Medal of Honor winner Tibor "Ted" Rubin was imprisoned there as a young teenager; a Hungarian Jew, he vowed to join the U.S. Army upon his liberation and later did just that, distinguishing himself in the Korean War as a corporal in the 8th Cavalry Regiment, 1st Cavalry Division.
Following the capitulation of Germany, the Mauthausen-Gusen complex fell within the Soviet sector of occupation of Austria. Initially, the Soviet authorities used parts of the Mauthausen and Gusen I camps as barracks for the Red Army. At the same time, the underground factories were being dismantled and sent to the USSR as a war booty. After that, between 1946 and 1947, the camps were unguarded and many furnishings and facilities of the camp were dismantled, both by the Red Army and by the local population. In the early summer of 1947, the Soviet forces had blown the tunnels up and were then withdrawn from the area, while the camp was turned over to Austrian civilian authorities. However, it was not until 1949 that it was declared a national memorial site. Finally, 30 years after camp's liberation, on 3 May 1975, Chancellor Bruno Kreisky officially opened the Mauthausen Museum. Unlike Mauthausen, much of what constituted the sub-camps of Gusen I, II and III is now covered by residential areas built there after the war.
In February 2009 the memorial was vandalized by persons unknown, who defaced a section of the wall with anti-Islamic graffiti.