The territory of Moldavia was a part of the Halych-Volhynian Kingdom before it was conquered by the Mongols and incorporated into the Golden Horde in the 13th century. Moldavia was captured by Hungary in 1352/1353 and organized as a frontier march but Moldavians under leadership of Bogdan I (1359-1365) gained independence from Hungary already in 1359. Moldavia returned under Hungarian overlordship after Bogdan’s death but it was ruled by its native princes.
Moldavia became a Polish vassal state after the collapse of the Polish-Hungarian in 1385 but Moldavian princes held almost absolute power. At the same time Moldavia was threatened by the advancing Ottoman forces but Alexander the Good (1400-1432) managed to repulse the Ottoman threat in alliance with Poland. Moldavia reached its zenith under Stephen the Great (1457-1504) who successfully withstood all Hungarian, Polish and Ottoman attacks but the Ottomans conquered Moldavia after Stephen’s death and incorporated the country into the Ottoman Empire.