The rule of the Jagiellonian dynasty in Poland between 1386 and 1572 spans the Late Middle Ages and the Early Modern Period in European history. The Lithuanian Grand Duke Jogaila (Władysław II Jagiełło) founded the dynasty; his marriage to Queen Jadwiga of Poland in 1386 strengthened an ongoing Polish–Lithuanian union. The partnership brought vast territories controlled by the Grand Duchy of Lithuania into Poland's sphere of influence and proved beneficial for both the Polish and Lithuanian people, who coexisted and cooperated in one of the largest political entities in Europe for the next four centuries.
In the Baltic Sea region, Poland engaged in ongoing conflict with the Teutonic Knights. The struggles led to a major battle, the Battle of Grunwald of 1410, but there was also the milestone Peace of Thorn of 1466 under King Casimir IV Jagiellon; the treaty defined the basis of the future Duchy of Prussia. In the south, Poland confronted the Ottoman Empire and the Crimean Tatars, and in the east Poles helped Lithuania fight the Grand Duchy of Moscow. Poland's and Lithuania's territorial expansion included the far north region of Livonia.