Peter was Alexis’ youngest son and the child of his second wife, neither of which promised great things. Tsar Alexis also had three children by his first wife: Feodor, an invalid; Sophia; and Ivan, a semi-imbecile. When Alexis died in 1676 Feodor became Tsar, but his poor constitution brought an early death in 1682. The family of Peter's mother succeeded in having him chosen over Ivan to be Tsar, and the ten year-old boy was brought from his childhood home at the country estate of Kolomenskoe to the Kremlin. No sooner was he established, however, than the Ivan's family struck back. Gaining the support of the Kremlin Guard, they launched a coup d'etat, and Peter was forced to endure the horrible sight of his supporters and family members being thrown from the top of the grand Red Stair of the Faceted Palace onto the raised pikes of the Guard. The outcome of the coup was a joint Tsar-ship, with both Peter and Ivan placed under the regency of Ivan's elder and not exactly impartial sister Sophia. Peter had not enjoyed his stay in Moscow, a city he would dislike for the rest of his life.
After Ivan died, Peter was in sole possession of the throne. Rather than taking up residence and rule in Moscow, he embarked on a Grand Tour of Europe. He spent about two years there, not only meeting monarchs but also traveling incognito and even working as a ship's carpenter in Holland. He amassed considerable knowledge of western European industrial techniques and state administration, and became determined to modernize the Russian state and society.
One of the Peter's main goals was to regain access to the Baltic Sea and Baltic trade. In 1700 he started the Northern War with Sweden, which lasted for 21 years. In the course of the war St. Petersburgs was founded (1703) in the Neva River delta. At the end of the war Russia was victorious and conquered the vast lands on the Baltic coast. Russia gained access to European trade and St. Petersburg became her major sea port.