The two emerged as vassals of the Hungarian Crown, and remained so until their independence. In 1476 Wallachia and in 1538 Moldavia came under formal Ottoman suzerainty, preserving their self-rule in all aspects, except for the period of the so-called Phanariote Rule, when foreign affairs were dictated by the Sublime Porte. After a marked decline in independence and prosperity over the 17th and 18th centuries, further independent and insurgent rules, which connected the two countries with Habsburg and Russian Empire offensives during the Great Turkish War, were blocked by the Ottomans by the introduction of Phanariote rules over the two countries — 1711 in Moldavia and 1714 in Wallachia). These, while connected with the very first administrative reforms, generally had to rely on spoliation, and coincided with a disastrous stage in the countries' history, given that the two became a major theatre of war in a series of confrontations between Russian, Habsburg, and Ottoman forces.
's coat of arms The two countries became connected with the cause of Greek independence during the Greek Independence War: the Filiki Eteria, backed by most Phanariotes, maneuvered in Moldavia, while the 1821 Wallachian uprising combined anti-Phanariote sentiment with an allegiance to the Eteria - ultimately, these two aspects came into conflict inside the movement itself, and Wallachian initiative was toppled by an Eteria administration which had to retreat in the face of Ottoman invasion. Although these events brought about the disestablishment of Phanariote rules by the Porte itself, this was of little consequence in itself, as a new Russo-Turkish War brought a period of Russian occupation under formal Ottoman supervision, extended between 1829 and the Crimean War. A parallel Russian military administration was put in place, while the two principalities were given the first common governing document : although never fully implemented, it confirmed a modernizing government, created a new legal framework that reformed public administration, and deeply influenced political life in the following decades. The Russian pressures for changes in the text were perceived by Wallachians and Moldavians as a drive to remove the territories from Ottoman rule and annex them to a much more centralised and absolutist empire. This coincided with the period of national awakening and the Revolutions of 1848 - the rejection of Russian tutelage during the Moldavian attempt and the Wallachian revolutionary period were viewed with a degree of sympathy by the Porte, but calls by Russia ultimately led to a common occupation in the years following the rebellion's crushing.
The aftermath of Russian defeat in 1856 brought forth a period of common tutelage of the Ottomans and a Congress of Great Powers. While the Moldavia-Wallachia unionist cause, which had come to dominate political demands, was viewed with sympathy by the French, Russians, Prussians, and Sardinians, it was rejected by the Austrian Empire, and viewed with suspicion by Great Britain and the Ottomans. Negotiations amounted to an agreement over a minimal and formal union - however, elections for the ad hoc divans of 1859 profited from an ambiguity in the text of the final agreement and made possible the rule of Alexander Ioan Cuza as Domnitor of the United Principalities of Moldavia and Wallachia. The union was cemented by Cuza's unsanctioned interventions in the text of previous organic laws, as well as by the circumstances of his deposition in 1866, when the rapid election of Carol of Hohenzollern-Sigmaringen, who had the backing of an increasingly important Prussia, and the Austro-Prussian War made measures taken against the union impossible. In 1878, after the Romanian War of Independence, Romania shook off formal Ottoman rule, but clashed with its Russian ally over the Russian request for the Bujak - ultimately, Romania was awarded Northern Dobruja in exchange for Southern Bessarabia. A Kingdom of Romania emerged in 1881.