Despite the stalemate on both fronts in Europe, two important developments in the war occurred in 1917. In early April, the United States, angered by attacks upon its ships in the Atlantic, declared war on Germany. Then, in November, the Bolshevik Revolution prompted Russia to pull out of the war.
In March 1917, demonstrations in St Petersburg culminated in the abdication of Tsar Nicholas II and the appointment of a weak Provisional Government which shared power with the Petrograd Soviet socialists. This arrangement led to confusion and chaos both at the front and at home. The army became increasingly ineffective.
The war and the government became more and more unpopular. Discontent led to a rise in popularity of the Bolshevik party, led by Vladimir Lenin. He promised to pull Russia out of the war and was able to gain power.
The triumph of the Bolsheviks in November was followed in December by an armistice and negotiations with Germany. At first the Bolsheviks refused the German terms, but when Germany resumed the war and marched across Ukraine with impunity, the new government acceded to the Treaty of Brest-Litovsk on 3 March 1918.
It took Russia out of the war and ceded vast territories, including Finland, the Baltic provinces, parts of Poland and Ukraine to the Central Powers.
http://www.sparknotes.com/history/european/ww1/summary.html
https://en.wikipedia.org/wiki/World_War_I#Russian_Revolution