Towards the end of the 19th century, Riga, the capital of Latvia, became one of the most industrialised cities in the Russian Empire. The Latvian Social Democratic Workers' Party (LSDRP) was well organised and its leading elements were increasingly sympathetic to the Bolsheviks by the time of the 1905 Revolution. When punitive expeditions were mounted by the state following this, armed resistance groups - often affiliated to the LSDRP - were set up to conduct guerilla warfare against the Tsarist regime. Many of these seasoned fighters were subsequently recruited into the Latvian Rifles. At the outbreak of war Indriķis Lediņš, the Latvian chief of police in Vladivostok, had called for the establishment of Latvian Cavalry units.
By April 1915, when the German Army was advancing into Latvian territory, some prominent Latvians, led by Jānis Goldmanis used their position in the Duma to call on the Tsar to establish all-Latvian battalions. As Germany was advancing into Latvia, they argued, such units would be particularly effective. Latvians knew the area and had high morale because despite the policy of Russification, Latvian nationalist sentiments were more anti-German. At Jelgava two battalions of the Latvian Home Guard had already held back the German advance guard.
Following increasing German advances, the Russian Stavka approved the measure and on 19 July 1915 the Tsar approved the formation of the Latvian Rifles. On the same day Latvian deputies Jānis Goldmanis and Jānis Zālītis published a patriotic appeal Pulcējaties zem latvju karogiem ("Gather under Latvian flags") in Riga. First volunteers started to apply on August 12 at Riga. It was planned to form two battalions but volunteers were so many that actually three battalions were formed.
Departure of the first Latvian volunteers from Riga to training camp transformed to a wide national demonstration, because those were the first Latvian military units with Latvian commanders ever formed. The first battalions consisted mainly from volunteers, especially refugees from Courland and workers from the factories evacuated to inner Russia from Riga. Later a number of Latvians from other Russian units joined or were transferred to the Latvian Rifles.
From 1915 to 1917, the Latvian Riflemen fought in the Russian army against the Germans in positions along the Daugava river. In 1916 Latvian battalions were transformed to regiments as conscription started among the local population. Also many new riflemen units were formed. In total eight combat and one reserve regiment were formed. In December 1916 and January 1917, the Latvian riflemen suffered heavy casualties in the month-long Christmas Battles, which began with a surprise attack on German positions during Christmas. Suffering heavy casualties, Latvian riflemen managed to break the German line of defence but the effort was wasted as the attack was not followed through. The Russian Army lost over 26,000 soldiers in the failed attack. The casualties included 9,000 Latvian riflemen, about a third of the total number at that time. The heavy casualties resulted in a strong resentment against the Russian generals and the Tsar among the riflemen. This resentment led to an increased support for the Bolsheviks, who were advocating an end to the war.