After Louis' death in 1382, a dispute over succession arose between rival factions of the nobility. In 1384 the magnates (nobles of the highest rank) elected Louis' daughter, Jadwiga, queen. In 1386 she married Jagiello, a Lithuanian duke, who, with the consent of the magnates, came to the throne as Wladyslaw II (reigned 1386–1434). The marriage was the beginning of the Jagiellon dynasty.
Raids by the Teutonic Knights continued to be a threat to Poland's northern frontier. In 1410 a combined Polish-Lithuanian army defeated the Knights in the Battle of Tannenberg. Hostilities continued intermittently until 1466, when the Knights were defeated at Toruń in East Prussia. In the Treaty of Toruń, the Knights agreed to incorporate much of their territory into Poland and pledged allegiance to the Polish king, Casimir IV.
The period from the late 15th century to the end of the 16th century has been called the golden age of Poland. The Renaissance flourished there and the country reached the height of its power and influence. Political reforms limited royal power and gave supreme legislative authority to the nobility. In 1493 the Sejm (parliament) was formed, representing the nobility. A constitution was adopted by the Sejm in 1505, requiring parliamentary assent for all legislation.
In the 16th century, border disputes with Russia led to a state of almost continuous warfare. In 1569 the Union of Lublin formally united Poland and Lithuania under Polish authority. The reign of the Jagiellon dynasty ended with the death of Sigismund II in 1572.