became king after the agreement between him, Casimir III the Great and the Polish nobility (Privilege of Buda). Louis had no sons, which created another dilemma for the succession of the Polish throne. In an attempt to secure the throne of Poland for his line, he gathered the nobles and sought their approval to have one of his daughters retained as the queen regnant of Poland in exchange for the Privilege of Koszyce (1374). The next election of a Polish king had occurred in 1386, with the selection of Władysław II Jagiełło (Jogaila), Grand Duke of Lithuania, as the first king of Poland's second dynasty. The electors chose Władysław II Jagiełło as king, and he married a daughter of Louis I, Jadwiga of Poland, but had no promise that his dynasty would continue on the throne. He would need to issue more privileges to the nobility to secure the guarantee that upon his death, one of his sons would inherit. The royal council chose the candidates, and the delegates of nobility and towns confirmed them during the sejm. The principle of election continued in effect throughout the nearly two centuries of the Jagiellon Dynasty, but just as in Piast times, it actually amounted to mere confirmation of the incoming heir. One could describe the monarchy of Poland at that time as "the hereditary monarchy with a[n] elective legislature." A major reason was the desire on the part of Polish nobility to retain the Polish–Lithuanian union, and the Jagiellon dynasty were the hereditary rulers of the Grand Duchy of Lithuania. Nonetheless, the pretense of having a choice by elections remained important for the nobility, and when in 1530 Sigismund I the Old attempted to secure the hereditary throne for his 10-year-old son, there was a political crisis, and the Polish parliament, the sejm, ruled that a new king could be chosen during the life of his predecessor (that became known in the Polish politics as the vivente rege). In 1572, Poland's Jagiellon dynasty became extinct upon the death, without a successor, of King Sigismund II Augustus. During the ensuing interregnum, anxiety for the safety of the Commonwealth eventually led to agreements among the political classes that pending election of a new king, the Roman Catholic Primate of Poland would exercise supreme authority, acting as interrex (from the Latin); and that special "hooded" confederations (Polish: konfederacje kapturowe, named after the hoods traditionally