His abdication was a culmination of various factors, including military setbacks in World War I, internal political unrest, and growing dissatisfaction among the Russian populace with the czarist regime. The February Revolution, sparked by widespread strikes and demonstrations in Petrograd (now St Petersburg) in late February 1917, led to the formation of a provisional government and eventually compelled Czar Nicholas II to relinquish power.
After his abdication, Nicholas and his family were initially placed under house arrest in the Alexander Palace in Tsarskoye Selo. However, their situation deteriorated following the Bolshevik seizure of power during the October Revolution in November 1917.
In the midst of the Russian civil war, the royal family was moved from Tsarskoye Selo to Yekaterinburg, a city in the Ural Mountains. On the night of July 16-17, 1918, Nicholas, along with his wife, Empress Alexandra, their five children (Olga, Tatiana, Maria, Anastasia, and Alexei), and four retainers, were executed by a firing squad in the basement of the Ipatiev House, on the orders of the local Bolshevik authorities.
The execution of the Imperial family marked a tragic end for the monarchy in Russia and paved the way for the rise of the Soviet Union under the Bolshevik regime led by Vladimir Lenin.