Original: He was able to gradually win his way back into the graces of Hungary's monarch, and eventually marry a member of the royal family.
Simplified: He was able to gradually win his way back into the graces of King Matthias.