The union was transformed to a closer one by the Union of LOCATION@1 in NUMBER@1 , which was shortly followed by the end of the Jagiellon dynasty that had ruled LOCATION@2 for two centuries and Gediminids dynasty , that ruled LOCATION@3 for about NUMBER@2 years .

The union was confirmed but also transformed by the ORGANIZATION@1 in NUMBER@1 , which was shortly followed by the end of the Jagiellon dynasty that had ruled LOCATION@2 for two centuries .
