Duke of Lodi explained

The title of Conte di Magenta was created on 30 December 1619 for Don Luigi Melzi, of a Milanese patrician family. His descendant Gaspare, eighth Count, married Maria Teresa d'Eril, daughter and heiress of the Marchese de Fuente Sagrada, and their descendants adopted the name Melzi d'Eril. Francesco Melzi d'Eril, ninth Count, was made Vice-President of the Italian Republic under Napoleon Bonaparte in 1802, and Grand Chancellor of the Napoleonic Kingdom of Italy in 1805. On 20 December 1807 he was created Duca di Lodi by Napoleon in his capacity as King of Italy. The Duke was childless, and adopted as his heir his nephew Giovanni Francesco. On his death he was succeeded as tenth Count by his brother Luigi. The Emperor of Austria, as King of Lombardy–Venetia after the Congress of Vienna, recognised the comital title of Magenta in 1816, but did not recognise the Napoleonic dukedom of Lodi. However, Giovanni was given the title of Duca Melzi on 5 September 1818. His son Lodovico, twelfth Count of Magenta, reassumed the title of Duca di Lodi in 1859. The titles of Duca di Lodi and Conte di Magenta were recognised for his successors by ministerial decrees of the new Kingdom of united Italy dated 1890, 1913 and 1939. While there are still heirs to these titles, they were unrecognized after 1948 along with all other Italian noble titles.

Conte di Magenta (1619)

Duca di Lodi (1807)

Sources