The purpose of this essay is to examine the role and function of libraries in the event of war. Two research questions are posed: 1. "How do the municipality, region, and library view the role and function of libraries in the event of war?" 2. "What influences and how do the municipality, region, and library work and plan regarding the role and function of libraries in the event of war?" The essay has aimed to conduct a comparative study between libraries in Västerås and Gotland. The selection has been made with Gotland in mind, particularly vulnerable to military threats due to a deteriorating security situation in the Baltic Sea region. Västerås municipality is interesting in the aspect that during the pandemic years, Västerås has been clear that libraries are a vital societal service that must remain open during crisis situations. Semi-structured interviews were conducted with four individuals, either employed at a library or within the municipality. The interviews were analyzed using thematic analysis (Bryman, 2018), and five themes were identified: Library Law, political perspective, safety point, total defense, and vital societal service. The concept of legitimacy from new institutional theory and a framework for robust decision-making have been applied in the analysis of the results. Among the results, the role and function of libraries cannot be clearly identified. Depending on how the Library Law is interpreted, where libraries' municipality and region stand in robust decision-making, and whether libraries have found political legitimacy or not, the preparedness plans of libraries are affected. The role and function of libraries in the event of war will vary in different municipalities and regions.