Time of Troubles
Ivan IV, the Terrible, was the first Russian ruler to be crowned czar, but when he died, in 1584, he left an uncertain legacy. He had murdered his oldest son and his only legitimate heir, Fyodor, was an idiot.
Power passed to Boris Godunov who had been at Ivan's deathbed. Boris Godunov's 20-year reign was mostly successful until, in 1601, a defrocked monk in Poland claimed to be Dmitry, a son of Ivan IV. (The real Dmitry had died during an epileptic seizure).
The False Dmitry found support in Poland and among many Cossacks. The pretender gathered an army and marched on Moscow. Godunov's army defeated the inept force, but a few weeks later Godunov died and a group of boyars (nobles) declared Dmitry czar.
The chaotic period that followed became known as the Time of Troubles (1606-13).
First, a popular revolt brought the overthrow and assassination of Dmitry. A leader of the revolt and member of an aristocratic family, Vasily Shuysky, became the new czar. Within two years some boyars, led by the Romanovs, found a second False Dmitry. They manipulated Dmitry's ambitions while at the same time offering the crown to the son of the Polish king.
Shuysky, in desparation, turned to Sweden for help which caused the Polish king to invade Moscow. Dmitry disappeared and Shuysky was deserted by his army. The boyars aimed to install a Polish czar, which led a new insurgent army, staffed with Swedish troops, to march on Moscow.
After the Poles were expelled from Moscow a new czar got elected from the Romanov family, an event that established the Romanov dynasty (1613) which ruled Russia for the next 300 years.