A Polish–Lithuanian union and military alliance had come about as a mutual response to common threats posed by the Teutonic Order and the Golden Horde and its successor states, including Muscovy. The alliance was first established in 1385 by the Union of Kreva, solemnized by the marriage of Poland's Queen Jadwiga and Lithuania's Grand Duke Jogaila, of the Gediminid dynasty, who became King Władysław II Jagiełło of Poland.