The 4th Bavarian Division consisted of troops drawn from the districts surrounding Bamberg, Würzburg, Schweinfurt, Metz and Pirmasens. The division consisted of four regiments of infantry in 1914: 5th, 9th, 5th Reserve and 8th Reserve Bavarian regiments. These regiments took part in the opening moves of the war in August 1914 and among other locations fought on the Somme and Flanders in 1914, the Artois, Loos and Hulluch in 1915 including heavy fighting near the Hohenzollern Redoubt in October of that year. During their time in the Artois the regiments took part in extensive mine warfare against the opposing lines so the men for the most part were no strangers to the devastation of the mine warfare they were to experience in 1917. In 1915 the 8th Bavarian RIR was detached from the division and became part of the 10th Bavarian Division.
The 4th Division was sent to The Somme in 1916 and was heavily involved in the fighting near Flers-Courcelette. The 9th Bavarian Regiment, in particular the III Battalion (9th, 10th, 11th and 12th Coy) suffered heavily while on the Somme. This battalion faced the first tank attack of the war, the Battle of Flers-Courcelette on 15 September 1916. After the division was relieved it was sent to a relatively quiet area opposite Ploegsteert Wood where it would remain until mid June 1917. While in the new position the regiments were able to reorganize the companies and fill up the empty ranks with new recruits.
Their possition in the Battle of Messines was on the Southern edge of the ridge in the line, south of River Douve and opposite Ploegsteert wood, where two mines were detonated in the launch of the attack, Trench 122 right and left (also known as Ultimo and Factory Farm), many men were killed instantly and many more were taken prisoner as the Australian 3rd Division advanced.
In June 1917 the 4th Division was under the command of Gen-Maj. Prinz von Bayern and consisted of: