The founding of Moldavia (Romanian: Descălecatul Moldovei) began with the arrival of a Vlach (Romanian) voivode (military leader), Dragoș, soon followed by his people from Maramureș, then a voivodeship, to the region of the Moldova River. Dragoș established a polity there as a vassal to the Kingdom of Hungary in the 1350s. The independence of the Principality of Moldavia was gained when Bogdan I, another Vlach voivode from Maramureș who had fallen out with the Hungarian king, crossed the Carpathians in 1359 and took control of Moldavia, wresting the region from Hungary. It remained a principality until 1859, when it united with Wallachia, initiating the development of the modern Romanian state.
 Moldavia developed in the lands between the Carpathian Mountains and the Dniester River, which had been dominated by nomadic Turkic peoples—the Pechenegs, Ouzes and Cumans—from around 900. The neighboring Principality of Halych and Kingdom of Hungary started to expand their authority over parts of the territory from around 1150, but the Golden Horde—a Mongol and later Turkicized khanate—took control of the lands east of the Carpathians in the 1240s. The Mongols promoted international commerce, and an important trade route developed along the Dniester. The circulation of Hungarian and Bohemian coins shows that there were also close economic contacts between the basin of the Moldova and Central Europe in the early 14th century.
 In addition to the dominant Turkic population, medieval chronicles and documents mention other peoples who lived between the Carpathians and the Dniester, including the Ulichians and the Tivercians in the 9th century, and the Brodnici and the Alans in the 13th century. The Vlachs' presence in that territory is well documented from the 1160s. Their local polities were first mentioned in the 13th century: the Mongols defeated the Qara-Ulagh, or Black Vlachs, in 1241, and the Vlachs invaded Halych in the late 1270s.
 The Moldavian region—the lands between the Eastern Carpathians and the Dniester River—acquired a territorial identity in the 14th century. During the previous millennium, the region had been subject to invasions by nomadic peoples, followed by a peaceful period around 750 during the Khazar Khaganate, which led to growth of the population the region. A new material culture—the "Dridu culture"—spread in the lands along the Lower Danube (in both present-day Bulgaria and Romania) and in the territory east of the Carpathians. After the arrival of the Magyars to the Pontic steppes north of the Black Sea in the 830s, the local inhabitants fortified their settlements with palisades and deep moats along the Dniester in the 9th century. The Ulichians, Tivercians, "Waladj", and "Blaghā" are ethnic groups that have been connected with the Vlachs, or Romanians, of the region of the Carpathians.[failed verification][neutrality is disputed]
 Victor Spinei wrote that a runestone which was set up around 1050 contains the earliest reference to Romanians living east of the Carpathians. It refers to Blakumen who killed a Varangian merchant at an unspecified place.
 A competing group, the Magyars, left the Pontic steppes for the Carpathian Basin after a coalition of the Pechenegs and the Bulgarians defeated them at the end of the 9th century. The Pechenegs took control of the territory, but most Dridu settlements survived their arrival. Only the fortifications were destroyed in the 10th or early 11th centuries. New settlements appeared along the lower course of the Prut. The local inhabitants' burial rites radically changed: inhumation replaced cremation and no grave goods can be detected after around 1000.
 According to the Persian historian, Rashid-al-Din Hamadani, a Mongol army "proceeded by way of the Qara-Ulagh, crossing the mountains … and defeating the Ulagh peoples" during the Mongol invasion of 1241. His narrative shows that the "Quara-Ulagh," or Black Vlachs, lived in the Eastern or Southern Carpathians. Giovanni di Plano Carpini, a papal envoy to the Great Khan of the Mongols, met a "Duke Olaha" who "was leaving with" his retinue to the Mongols in 1247. Victor Spinei, Vlad Georgescu and other historians identify the duke as a Vlach ruler, because his name is similar to the Hungarian word for Vlach (oláh), but the name may have also been a version of Oleg. Friar William of Rubruck, who visited the court of the Great Khan in the 1250s, listed "the Blac", or Vlachs, among the peoples who paid tribute to the Mongols, but the Vlachs' territory is uncertain. Rubruck described "Blakia" as "Assan's territory" south of the Lower Danube, showing that he identified it with the northern regions of the Second Bulgarian Empire.
 Archaeological finds—kilns to produce pottery and furnaces to puddle iron ore—identify towns that were important economic centers of the Golden Horde. At Orheiul Vechi, the ruins of a mosque and a bath were also excavated. The local inhabitants used high quality ceramics (amphorae-like vessels, pitchers, mugs, jars and pots), similar to those found in other parts of the Golden Horde. The Mongols supported international commerce, which led to the formation of a "Mongol road" from Kraków along the Dniester. Almost 5000 Mongol coins from the first half of the 14th century have been excavated in the same region. At the mouth of the Dniester, Cetatea Albă (now Bilhorod-Dnistrovskyi in Ukraine) developed into an important emporium. It was established by Genoese merchants in the late 13th century.
 Weapons and harness pieces from the 13th and 14th centuries that have been found together with agricultural tools at Vatra Moldoviței, Coșna and Cozănești shows the existence of either local elites or armed peasant groups between the Carpathians and the upper courses of the Siret. Hungarian and Bohemian coins were in circulation in the same territory during the first half of the 14th century. The local inhabitants used pottery of lower quality than those used in the lands directly controlled by the Mongols.
 The earliest contemporary reference to Romanians in Maramureș was recorded in a royal charter in 1326. In that year, Charles I of Hungary granted the "land Zurduky" (now Strâmtura in Romania) in the "district of Maramureș" to a Vlach noble, Stanislau. According to the Moldo-Russian Chronicle, which was preserved in a Russian annals completed in 1505, King Vladislav of Hungary sent envoys to invite the "Old-Romans and the Romanians" to fight against the Mongols and afterwards he rewarded the "Old-Romans" with lands in Maramureș. Historians Ionel Cândea and Dumitru Țeicu identify this event with the battle of Hód Lake (1280), Cuman opponents being substituted in the chronicle by tartars. Historians Pavel Parasca and Șerban Papacostea identify "King Vladislaus" with Ladislaus IV of Hungary who reigned between 1270 and 1290.
With the disintegration of the Golden Horde after the death of Öz Beg Khan in 1341, both Poland and Hungary started to expand towards the steppe zone in the 1340s. Casimir III of Poland invaded the Principality of Halych already in 1340. Two 14th-century chronicles—one by John of Küküllő and the other by an anonymous Minorite friar—say that King Louis I of Hungary dispatched Andrew Lackfi, Count of the Székelys, to lead an army of Székely warriors against the Mongols who had made raids in Transylvania. Lackfi and his army inflicted a crushing defeat upon a large Mongol army on 2 February 1345. The Székelys again invaded the "land of the Tatars" in 1346. According to both chronicles, the Mongols withdrew as far as the Dniester after their defeats. Archaeological research shows that forts were erected at Baia, Siret, Piatra Neamț and Târgu Trotuș in the late 1340s.
 Both Poland and Hungary took advantage of the decline of the Golden Horde by starting a new expansion in the 1340s. After a Hungarian army defeated the Mongols in 1345, new forts were built east of the Carpathians. Royal charters, chronicles and place names show that Hungarian and Saxon colonists settled in the region. Dragoș took possession of the lands along the Moldova with the approval of King Louis I of Hungary, but the Vlachs rebelled against Louis's rule already in the late 1350s. Dragoș was succeeded by his son, Sas, but Sas' son was expelled from Moldavia by a former voivode of the Voivodeship of Maramureș, Bogdan, in the early 1360s. Bogdan, who resisted Louis's attempts to restore Hungarian suzerainty for several years, was the first independent ruler of Moldavia. The earliest Moldavian silver and bronze coins were minted in 1377. The Ecumenical Patriarchate of Constantinople acknowledged the Metropolitan See of Moldavia, after years of negotiations, in 1401.
 The dates on coins found in the area indicate the change of status of Moldavia from Mongolian rule to Vlach rule. The minting of Mongol coins continued in Orheiul Vechi until 1367 or 1368, showing that a "late Tatar state" survived in the southern region between the Prut and the Dniester. No Mongol coins minted after 1368 or 1369 have been found in the region of the Dniester, showing that the Mongol rulers did not control the territory any more. Moldavia initially included a small territory between the Prut and Siret. Louis exempted the merchants of "Demetrius, Prince of the Tatars" from paying taxes in Hungary in exchange for securing the tax exempt status of the merchants of Brașov in "the country of Lord Demetrius".
 Romanian histories cite Moldavian chronicles, which credit Dragoș, a Vlach ruler, with the founding of Moldavia. According to legend, he led a hunting party to the region and dismounted from his horse at the Moldova River—hence the name of this event, descălecat or "dismounting". It was during this hunting trip that he judged the region to be more attractive for his people than the Land of Maramureș in the Kingdom of Hungary, where they were then living. One theory by Nicolae Iorga suggests that the Land of Maramureș was one of the "Romanias" where Eastern Romance ethnic groups (known as Vlachs in the Middle Ages) had survived the Great Migrations. A concurrent theory suggests that the Vlachs of Maramureș came from Great Vlachia (in present-day Macedonia) in the second half of the 13th century.
 According to the early 16th-century Moldo-Russian Chronicle, the Vlachs came to Maramureș during the reign of King Vladislaus of Hungary to fight against the Mongols. This document represents Dragoș as one of the Romanians whom "King Vladislav" had granted estates in Maramureș. According to the various versions of the legend of his "dismounting", Dragoș left for a hunting, together with his retainers. While chasing an aurochs or bison, they reached as far as the Moldova River where they killed the beast. They liked the place where they stopped and decided to settle on the banks of the river. Dragoș went back to Maramureș only to return with all his people "on the fringes of the lands where the Tatars roamed". Ritual huntings which end with the establishment of a state, a town or a people are popular elements of the folklore of various peoples of Eurasia, including the Hungarians and the Lithuanians.
 The "dismounting" by Dragoș took place in 1359, according to most Moldavian chronicles. Except that the Moldo-Polish chronicle which gives 1352 as the date. However, the same chronicles add various years when determining the period between Dragoș's arrival to Moldavia and the first year of the reign of Alexander the Good in 1400. For instance, the Anonymous Chronicle of Moldavia mentioned 44 years, but the Moldo-Russian Chronicle wrote of 48 years. Consequently, the date of the dismounting is debated by modern historians. For instance, Dennis Deletant says that Dragoș came to Moldavia soon after the establishment of the Diocese of Milkovia in 1347. Neagu Djuvara estimates the foundation of Moldavia to around the time of Andrew Lackfi's decisive victory over the Tatars in 1345.
 Moldavia emerged as a "defensive border province" of the Kingdom of Hungary. A version of Grigore Ureche's chronicle stated that Dragoș's rule in Moldavia "was like a captaincy", implying that he was a military commander. King Louis I of Hungary mentioned Moldavia as "our Moldavian land". The province initially included the northwestern part of the future principality (it is now known as Bukovina). In 1360, Louis granted estates to a Vlach lord, Dragoș of Giulești, for subjugating the Moldavian Vlachs who had revolted against Louis. The identification of Dragoș of Giulești with the first ruler of Moldavia is debated among scholars.
 Most early Moldavian chronicles begin their lists of the rulers of Moldavia with Dragoș and state that he was succeeded by his son, Sas, who ruled for four years. The only exception is the list of the voivodes, which was recorded in the Bistrița Monastery in 1407, which starts with "Bogdan Voivode". Bogdan, who had been the voivode of the Vlachs in Maramureș, gathered the Vlachs in that district and "secretly passed into Moldavia", according to John of Küküllő's chronicle. Royal charters recorded that Bogdan had come into a conflict with János Kölcsei, the royal castellan of Visk (now Vyshkovo in Ukraine), in 1343, and with a Vlach lord in Maramureș, Giula of Giulești, in 1349. According to historian Radu Carciumaru, Bogdan's conflict with the royal castellan suggests that he had been opposed to the presence of the representatives of royal authority in Maramureș years before he left for Moldavia.
 The dating of Bogdan's departure from Maramureș is uncertain. His estates there were confiscated and granted to the son of Sas, Balc, according to a royal diploma, issued on 2 February 1365. Consequently, Bogdan must have come to Moldavia before that date. Historian Pál Engel dates Bogdan's arrival as 1359, taking advantage of the power vacuum that followed the death of Berdi Beg, Khan of the Golden Horde. According to Carciumaru, a lasting conflict between King Louis I of Hungary and Charles IV, Holy Roman Emperor and the Lithuanians' victory over the Tatars in the Battle of Blue Waters in the early 1360s, enabled Bogdan to come to Moldavia and expel Balc in 1363. Sălăgean says that it was only in 1365 that Bogdan seized power in Moldavia with the assistance of local Vlachs.
 King Louis I of Hungary attempted to restore his rule in Moldavia, but the chronology of the military actions against Bogdan is uncertain. John of Küküllő wrote that Bogdan "was often battled against" by the army of Louis, but the "number of Vlachs inhabiting that land increased, transforming it into a country". Although Küküllő stated that Bogdan was finally forced to accept Louis's suzerainty and to pay a yearly tribute to him, modern historians – including Denis Deletant, Tudor Sălăgean, Victor Spinei, and István Vásáry – agree that Bogdan could actually preserve the independence of Moldavia.
 The new state derived its name from the Moldova River. In Latin and Slavic documents, it was mentioned as "Moldova", "Moldava" or "Moldavia". On the other hand, the Byzantines, who regarded it as a new Vlachia, referred to the country as Maurovlachia ("Black Vlachia"), Rusovlachia ("Vlachia near Russia") or Moldovlachia ("Moldavian Vlachia"). The Turkish name of Moldavia – Kara Boğdan – demonstrates Bogdan's preeminent role in the establishment of the principality.
 Bogdan was succeeded by his son, Lațcu, around 1367. After Franciscan friars from Poland converted him to Catholicism, Lațcu initiated the establishment of a Roman Catholic diocese in Moldavia in 1370. His direct correspondence with the Holy See shows that he wanted to demonstrate the independence of Moldavia. Upon Lațcu's request, Pope Gregory XI set up the Roman Catholic Diocese of Siret in 1371, addressing his bull to "Lațcu, Duke of Moldavia". According to Sălăgean, the Holy See "consolidated the international status of Moldavia" by granting the title "duke" to Lațcu. On 14 March 1372, King Louis I of Hungary, who had also inherited Poland in 1370, signed a treaty with Emperor Charles IV who acknowledged Louis's rights in many lands, including Moldavia.
 Lațcu, who died in 1375, was succeeded by Petru Mușat, according to the earliest lists of the rulers of Moldavia. However, the 15th-century Lithuanian-Ruthenian Chronicle wrote that the Vlachs elected George Koriatovich—who was a nephew of Algirdas, Grand Prince of Lithuania, and ruled in Podolia under Polish suzerainty—to be voivode, but later poisoned him. In late 1377, Vladislaus II of Opole, who administered Halych in the name of King Louis I of Hungary, gave shelter to one "Vlach voivode", named George, who had fled to Halych because of the "unexpected treason of his people".  According to Spinei, George Koriatovich died in 1375, which excludes his identification with "Voivode George". Spinei also says that George Koriatovich most probably ruled in southeastern Moldavia which had been liberated from Mongol rule. The first Moldavian silver and bronze coins were minted for Petru Mușat in 1377.
 According to a record in the register of the Genoese colony in Caffa on the Black See, two Genoese envoys were sent to "Constantino et Petro vayvoda" in 1386. Historians identified Voivode Constantino with Costea, whom the list of the voivodes of Moldavia, recorded in the Bistrița Monastery, mentioned between Lațcu and Peter. The record in the Caffa register suggests that the two voivodes—Costea and Petru Mușat—had the same position. The division of the medieval principality into two greater administrative units—Țara de Sus ("Upper Country") and Țara de Jos ("Lower Country")—each administered by a high official, the vornic, also implies the former existence of two polities, which were united by the Moldavian monarchs.
 
Petru Mușat paid homage to Władysław II Jagiełło, King of Poland, in Kraków on 26 September 1387. Upon Peter's request, Anton, the Orthodox Metropolitan of Halych, ordained two bishops for Moldova, one of them being Joseph Mușat, who was related to the voivode. However, the Ecumenical Patriarch of Constantinople refused to acknowledge their consecration. Petru Mușat expanded his authority as far as the Danube and the Black Sea. His successor, Roman I Mușat, styled himself "By the grace of God the Almighty, Voivode of Moldavia and her to the entire Vlach country from the mountains to the shores of the sea" on 30 March 1392. After years of negotiations, the Ecumenical Patriarch, Matthew I, acknowledged Joseph Mușat as Metropolitan of Maurovlachia in 1401. The Principality of Moldavia, grew to include the territory between the Eastern Carpathians and the Dniester river. It existed until 1859, when it united with Wallachia as the basis of the modern Romanian state; at various times, the state included the regions of Bessarabia (with the Budjak) and all of Bukovina.  The western half of Moldavia is now part of Romania, the eastern side belongs to the Republic of Moldova, while the northern and southeastern parts are territories of Ukraine.