The first known Polish ruler is Duke Mieszko I who adopted Christianity under the authority of Rome in the year 966. He was succeeded by his son, Bolesław I the Brave, who greatly expanded the boundaries of the Polish state and ruled as the first king in 1025. The following centuries gave rise to the mighty Piast dynasty, consisting of both kings such as Mieszko II Lambert, Przemysł II or Władysław I the Elbow-high and dukes like Bolesław III Wrymouth. The dynasty ceased to exist with the death of Casimir III the Great in 1370. In the same year, the Capetian House of Anjou became the ruling house with Louis I as king of both Poland and Hungary. His daughter, Jadwiga, later married Jogaila, the pagan Grand Duke of Lithuania, who in 1386 was baptized and crowned as Władysław II Jagiełło, thus creating the Jagiellonian dynasty and a personal union between Poland and Lithuania.