 Ferdinand's last marriage was to Eleonora Magdalena Gonzaga of Mantua-Nevers in 1651.Empress Eleonora was very pious and donated, among other things, for the Ursuline monastery in Vienna and the Order of the Starry Cross for noble women.She was also well educated and interested in art.