Following the deaths of Vytautas in 1430, another civil war ensued, and Lithuania was ruled by rival successors. Afterwards, the Lithuanian nobility on two occasions technically broke the union between Poland and Lithuania by selecting grand dukes unilaterally from the Jagiellonian dynasty. In 1440, the Lithuanian great lords elevated Casimir, Jogaila's second son, to the rule of the grand duchy. This issue was resolved by Casimir's election as king by the Poles in 1446. In 1492, Jogaila's grandson John Albert became the king of Poland, whereas his grandson Alexander became the grand duke of Lithuania. In 1501 Alexander succeeded John as king of Poland, which resolved the difficulty in the same manner as before. A lasting connection between the two states was beneficial to Poles, Lithuanians, and Ruthenians, Catholic and Orthodox, as well as the Jagiellonian rulers themselves, whose hereditary succession rights in Lithuania practically guaranteed their election as kings in accordance with the customs surrounding the royal elections in Poland.