Hedvig (known as Jadwiga in Poland) was crowned "king" in Poland's capital, Kraków, on 16 October 1384. Her coronation either reflected the Polish nobility's opposition to her intended husband, William, becoming king without further negotiation, or simply emphasized her status as queen regnant. With her mother's consent, Jadwiga's advisors opened negotiations with Jogaila, Grand Duke of Lithuania, who was still a pagan, concerning his potential marriage to Jadwiga. Jogaila signed the Union of Krewo, pledging to convert to Roman Catholicism and to promote his pagan subjects' conversion. Jogaila, who took the baptismal name Władysław, married Jadwiga on 15 February 1386. Jogaila, now in Polish styled Władysław Jagiełło, was crowned King of Poland on 4 March 1386. As Jadwiga's co-ruler, Jagiełło worked closely with his wife. Hedvig (or Jadwiga) was childless for over a decade. She became pregnant in late 1398 or early 1399. A newborn princess named Elizabeth Bonifacia was delivered on 22 June 1399 at Wawel Castle. However, the infant died after only three weeks, on 13 July 1399. Jadwiga, too, was on her deathbed. She died on 17 July 1399, four days after her newborn daughter. Thus, the Polish throne went over to the Jagiellonian dynasty of Lithuanian origin. The union of Poland and Lithuania was a decisive moment in the histories of both countries; it marked a beginning of the four centuries of shared history. By 1569 the Polish–Lithuanian union grew into a new state, the Polish–Lithuanian Commonwealth, and lasted until the Third Partition in 1795.