This power struggle ended in the summer of 1384, leading to a pause as the Christianization of Lithuania progressed. Jogaila went to the Polish nobility, the "szlachta", to ask to marry Queen Jadwiga of Poland. Their conversations about the marriage and Jogaila's converting to Christianity created a more stable relationship between Poland and the Grand Duchy of Lithuania. The treaty of the agreement, the Union of Krewo, set the two countries on a path of increasing closeness, eventually leading to the Polish–Lithuanian union. Jogaila was also forced to enter an understanding with his cousin Vytautas to accept Vytautas's claims and return his possessions. Jogaila (now given the name Władysław II Jagiełło) was elected king of Poland after being baptized and marrying Jadwiga in 1386. Lithuania, the last pagan state in Europe, embraced Christianity.