The victors turned Montjuïc into a memorial site, with religious celebrations in memory of the fallen and a new monument in the Santa Elena Moat. At the same time councils of war were held there once again and it served as a military prison for the officers and chiefs of the republican army. Two of the best-known inmates were Colonel Antonio Escobar Huerta and the president of the Generalitat Catalan government Lluís Companys.
When the Civil War broke out, Colonel Escobar was head of the 19th Division of the Civil Guard in Barcelona, which remained loyal to the Republic, fighting on several fronts during the Civil War. He surrendered in Ciudad Real and later transferred to Madrid where he was subjected to a summary trial in July 1939. On the petition of the High Court of Barcelona, where the case against those who had been the leaders of the Civil Guard in July 1936 was still open, he was transferred to this city. He entered Montjuïc Castle on 7 December and was court-martialled and sentenced to death on the twenty-first of the same month. Despite the appeals for a reprieve, he was finally executed on 8 February 1940 at six in the morning, kneeling with a crucifix in his hands.
However, the case that had the most political and symbolic significance was the imprisonment and execution of President Lluís Companys. On 13 August 1940 he was arrested at La Baule, in German-occupied France, at the request of the Spanish authorities, and imprisoned in La Santé prison in Paris. From there he was handed over to the Francoist government. After a few days at the General Directorate of Security in Madrid, he was transferred to Barcelona and Montjuïc Castle, where he was held in solitary confinement in the chaplain’s quarters by the Castle parade ground. Judicial proceedings began on 3 October and lasted just ten days. On 14 October 1940, following a summary court martial that lasted less than an hour, he was sentenced to death. He was found guilty of opposing the military uprising and tolerating crimes behind the lines, as well as military rebellion. At six in the morning on 15 October he was shot by firing squad in the Santa Eulàlia Moat. The Castle would be deeply marked by this crime.
Although its use as a military prison declined, the castle retained this function until 1960, when it was partially ceded to the city during a visit by General Franco to Barcelona. The central government continued to control the new management board, which was headed by the Captain General of Barcelona. The board was obliged to install a military museum, which would be financed by the City Council. In 1963 an equestrian statue of Franco was placed in the centre of the parade ground.
This change of status led to the last noteworthy overhaul of the Castle. This was carried out by the architect Joaquín Ros de Ramis, who made major alterations, especially in the inner ward. The military barracks located there were remodelled to become the military museum and a public park. The new project only affected the parade ground, the surrounding buildings and the roofs. The original facing was chipped off the walls and ceilings to leave exposed the stone underneath. In addition, the drawbridge was reconstructed, electric light was installed in various areas, running water in the lavatories, and some carpentry work was carried out. In the second phase of this project, the rooms under the sea-facing wall were refurbished to become part of the new facilities. The Military Museum was inaugurated on 24 June 1963.