In January 1942, the Third Reich assigned a liaison officer at the questura in Ljubljana to facilitate initial cooperation with Italian authorities regarding the relocation of Germans from the Province of Ljubljana. After the fall of Fascism in Italy in July 1943, Germans went for a swift conquest of Slovene lands and the Northern Adriatic. The attack of the Tomšič Brigade on a German transport train between Preserje and Borovnica on 23 August 1943 provided a rationale for entering the Province of Ljubljana. Three days later, Germans crossed the border near Šentvid and Črnuče much to the chagrin and futile protests of Italian commanders.
On 8 September 1943, the day Italy capitulated, only a small number of German soldiers were stationed in Ljubljana. It took just 1600 men to take over the Italian posts, barracks and bunkers along the wire around the city and to guard the surrendering Italians. In late September 1943, General Rösener, German advisor to the head of the provincial administration Leon Rupnik, established the Anti-Partisan warfare headquarters in Ljubljana which became instrumental for dealing with Partisan units. It was mostly German Police Regiments and Battalions who engaged in anti-Partisan combat. The Slovenian Home Guard had the biggest manpower. Changes of the military situation in the fall of 1944 expanded the tasks of the anti-Partisan units: the men were now assigned to build the fortified defence line that was supposed to protect the territory against a potential landing in Istria and the advancing Red Army. One of the defence lines was supposed to go from Tolmin to the east and continue north of Ljubljana, next down along Sava River and to northwest of Krško. From there it was to run along Sotla River, Drava River and Mura River up to the Austrian Border. The construction of trenches and fortifications continued almost until the end of the war. As the war drew to a close, only the units from the Province of Ljubljana assembled in the city. The last defence positions of German and Home Guard forces were positioned along the line Sostro – Zadvor – Orle – Lavrica – Babna Gorica – Črna vas – Bevke – Log – Horjul – Vrzdenec. Seeing as the path north was clear, after two days of fierce fighting these units retreated toward Gorenjska Region.