Sardinians, it was rejected by the Austrian Empire, and looked upon with suspicion by Great Britain and the Ottomans. Negotiations amounted to an agreement on a minimal formal union, to be known as the United Principalities of Moldavia and Wallachia but with separate institutions and thrones and with each principality electing its own prince. The same convention stated that the army would keep its old flags, with the addition of a blue ribbon on each of them. However, the Moldavian and Wallachian elections for the ad-hoc divans in 1859 profited from an ambiguity in the text of the final agreement, which, while specifying two separate thrones, did not prevent the same person from occupying both thrones simultaneously and ultimately ushered in the ruling of Alexandru Ioan Cuza as Domnitor (Ruling Prince) over both Moldavia and Wallachia from 1859 onwards, uniting both principalities. Alexander Ioan Cuza carried out reforms including abolishing serfdom and started to unite the institutions one by one in spite of the convention from Paris. With help from unionists, he unified the government and parliament, effectively merging Wallachia and Moldavia into one country and in 1862 the country's name was changed to United Principalities of Romania. Romania was created as a personal union that did not include Transylvania, where the upper class and the aristocracy remained mainly Hungarian, although Romanian nationalism clashed with Hungarian nationalism at the end of the 19th century. Austria-Hungary, especially under the Dual Monarchy of 1867, kept the territory firmly in control even in parts of Transylvania where Romanians constituted a vast majority. Independence and Kingdom of Romania In an 1866 coup d'état, Cuza was exiled and replaced with Prince Karl of Hohenzollern-Sigmaringen. He was appointed Domnitor, Ruling Prince of the United Principality of Romania, as Prince Carol of Romania. Romania declared its independence from the Ottoman Empire after the Russo-Turkish War (1877–1878), in which the Ottomans fought against the Russian empire. In the 1878 Treaty of Berlin, Romania was officially recognized as an independent state by the Great Powers. In return, Romania ceded the district Bessarabia to Russia in exchange for access to the Black Sea ports and acquired Dobruja. In 1881, the Romania's principality status was raised to that of a kingdom and on 26 March that year, Prince Carol became King Carol I of Romania. The period between 1878 and 1914 was one of stability and progress for Romania. During the