Italy conditioned its involvement in the First World War on the side of the Triple Entente with areas of South Tyrol, former Austrian Littoral, and Dalmatia that were to become Italian in case of victory. This was granted with the Treaty of London, while it gained the right to occupy with the armistice signed between Italy and Austria-Hungary on 3 November 1918. Along with the Littoral, Italy also occupied parts of Carinthia and Carniola and did not retreat from several smaller areas until the Treaty of Rapallo was signed on 12 November 1920. This moved the 250-km international border between the Kingdom of Serbs, Croats and Slovenes (later Yugoslavia) and the Kingdom of Italy on the ridgeline between the Black Sea and the Adriatic Sea, dividing the Slovenian nation and its territory. The border was only officially moved to the edge of the Po Valley when the Paris Peace Treaty in 1947 was signed.
In the 1920s and 1930s, Italy began systematically designing and building defence works along its entire land border and officially began reinforcing the Alpine Wall in 1931. Since 1924, military barracks were being constructed in every major town and, in 1933, they also began building underground fortifications to close passage towards the mainland. The defence system became operative after 1936, it was being upgraded until 1943, and used until well after the Second World War, until 1991.
In the area of the Idrija and Cerkno municipalities, there are several defence groups of the Alpine Wall with the common task of preventing the passage across Hrušica and the Trnovo Forest towards the Vipava Valley, or via the Idrijca River Valley to the Isonzo River Valley. The defence groups were positioned at Godovič, Črni Vrh nad Idrijo, Zadlog, Podroteja near the Wild Lake, Idrija, Spodnja Idrija, Želin, around Cerkno, and on Mount Porezen, while the space between them was filled with various temporary defence works and permanent rear artillery positions that are most well preserved in Idrijske Krnice. The majority of the defence groups were named twice – first after the near-by places, and second after fallen Italian soldiers and officers of the First World War. Directly on the border line, there was also a system of small barracks connected by numerous new roads that enabled the army to move around the area uninterrupted.