until 1739 when the Treaty of Belgrade was signed with Austria and the Treaty of Niš with Russia. The fourth Russo-Turkish War started in 1768 and ended in 1774 with the Treaty of Küçük Kaynarca. Another war with Russia started in 1787 and a concurrent war with Austria followed in 1788; the Austrian war ended with the 1791 Treaty of Sistova, and the Russian war ended with the 1792 Treaty of Jassy. An invasion of Egypt and Syria by Napoleon I of France took place in 1798–99, but ended due to British intervention. Napoleon's capture of Malta on his way to Egypt resulted in the unusual alliance of Russia and the Ottomans resulting in a joint naval expedition to the Ionian Islands. Their successful capture of these islands led to the setting up of the Septinsular Republic. 19th century The First Serbian Uprising took place in 1804, followed by the Second Serbian Uprising in 1815; Serbia was fully liberated by 1867. Officially recognized independence followed in 1878. The sixth Russo-Turkish War began in 1806 and ended in May 1812, just 13 days before Napoleon's invasion of Russia. The Moldavian–Wallachian (Romanian) Uprising (starting simultaneously with the Greek Revolution). The Greek War of Independence, taking place from 1821 to 1832, in which the Great Powers intervened from 1827, including Russia (seventh Russo-Turkish war, 1828–1829), achieved independence for Greece; the Treaty of Adrianople ended the war. Ottoman decline (1828–1908) The decline of the Ottoman Empire included the following conflicts. Albanian rebellions 1820–1822, 1830–1835, 1847. Bosnian rebellions 1831–1836, 1836–1837, 1841. War with Montenegro 1852–1853. Eighth Russo-Turkish war 1853–1856, Crimean War, in which the United Kingdom and France joined the war on the side of the Ottoman Empire. Ended with the Treaty of Paris. Second war with Montenegro in 1858–1859. War with Montenegro, Bosnia and Serbia in 1862. Cretan Uprising in 1866. Bulgarian Rebellion in 1876. The ninth and final Russo-Turkish War started in 1877, the same year the Ottomans withdrew from the Constantinople Conference. Romania then declared its independence and waged war on Turkey, joined by Serbians and Bulgarians and finally the Russians (see also History of Russia (1855–92)). Austria occupied Bosnia in 1878. The Russians and the Ottomans signed the Treaty of San Stefano in early 1878. After deliberations at the Congress of Berlin, which was attended by all the Great Powers of the time, the Treaty of Berlin (1878) recognized several territorial