The Safavid empire became weak towards the end of the 17th century CE. By the early 18th century, the once-mighty empire was in the grips of civil war and uprisings. The ambitious Peter I of Russia (Peter the Great) sent a force that captured Gilan and many of the Iranian territories in the North Caucasus, Transcaucasia, as well as other territories in northern mainland Iran, through the Russo-Persian War (1722-1723) and the resulting Treaty of Saint Petersburg (1723). Gilan and its capital of Rasht, which was conquered between late 1722 and late March 1723, stayed in Russian possession for about ten years.