A weakened and bankrupted royal court, under Fath Ali Shah, was forced to sign the notoriously unfavourable Treaty of Gulistan (1813) following the outcome of the Russo-Persian War (1804–1813), irrevocably ceding what is modern-day Dagestan, Georgia, and large parts of the Republic of Azerbaijan. The Treaty of Turkmenchay (1828) was the outcome of the Russo-Persian War (1826–1828), which resulted in the loss of modern-day Armenia and the remainder of the Azerbaijan Republic, and granted Russia several highly beneficial capitulatory rights, after efforts and initial success by Abbas Mirza failed to ultimately secure Persia's northern front. By these two treaties, Iran lost swaths of its integral territories that had made part of the concept of Iran for centuries. The area to the north of the Aras River, which included the territories of the contemporary nations of Georgia, Azerbaijan, Armenia and the North Caucasian Republic of Dagestan, were Iranian territory until they were occupied by Russia in the course of the 19th century.