His return to Mantua
In September 1499 the troops of Louis XII King of France defeated Ludovico il Moro who, obliged to leave Milan, took refuge in Ferrara. The collapse of the Sforza domination, just a few months after the death of his father Cristoforo, marked a sudden turning point in the life of Castiglione, who was forced to leave the city, interrupting a brilliant season of studies and socialising, to return home. Here, thanks to the good works and recommendations of his mother Aloisia, he was called into the service of the Marquis Francesco Gonzaga: but the young gentleman could not but note the contrast between the (ephemeral) splendours of the great court of the Sforzas and the parsimonious modesty of that of the Gonzagas.
The following October, following his master, Castiglione went to meet the victorious sovereign in Pavia, and then watched the entrance of the soldiers of the French in Milan. In a letter to his brother in law Giacomo Boschetto, dated 8th October 1499, he tells of the homage and honour the Italian princes there reunited, among them the Marquis of Mantua Francesco Gonzaga, Cesare Borgia il Valentino, and the Duke of Ferrara Ercole d’Este, paid to Louis XII. The letter revealed the perplexity of the future author of The Cortegiano, struck by the spectacle of Italian princes full of zeal in their courtship of the foreign invader, wanting to please him, win his favour and to offer their services in the most lucrative manner possible.
In Mantua the Marquis assigned Castiglione to modest military and diplomatic duties. From the month of January 1500 he took on the role of commissar of the fortress of Castiglione Mantovano, near the border with Verona, then threatened by the men of Ludovico Sforza.

