His military and political commitments
As the marriage between Guidubaldo and Elisabetta had not produced the desired fruits, in 1504 Pope Giulio II favoured the adoption by the ducal couple of his nephew, Francesco Maria Della Rovere. Thus, the day after the premature death of Guidubaldo, the nephew took over as the legitimate heir to the government of the state. With the advent of the new Duke, and the switch from the family of Montefeltro to the Della Rovere family, Castiglione decided to remain in service at the court of Urbino.
The years that run from 1508 to 1513 saw him immersed in the military turbulence created by the League of Cambrai, promoted by Giulio II to unite in a coalition the Italian and European states against Venice. Thus from May to July, following the Duke Francesco Maria, Baldassarre participated in the battle campaigns in Romagna, and fought at Brisighella, Granarolo, Russi and Ravenna. In September, having fallen ill due to tiredness and stress, he returned to Urbino, where, during the Christmas celebrations, he saw his mother again, who was there for the celebrations connected to the marriage of Eleonora Gonzaga to Francesco Maria Della Rovere.
In the spring of 1510 Castiglione went to Rome for the solemn confirmation, before the Pope, of the marriage between Eleonora and Francesco Maria. Then, when summer arrived, he went to Bologna to study the distribution of the troops of the Duke of Ferrara, against whom Giulio II had deliberated to wage war. In January 1511 he participated in the siege of Mirandola, together with the Duke of Urbino and the Pope. It was here that he drafted the carme latino Prosopopeia Ludovici Pici Mirandulani, in memory of his dead friend whose family were inside the besieged fortress.
During 1511, after the signature of the Lega Santa, wanted by Giulio II to put an end to French hegemony in Italy, Castiglione followed Francesco Maria Della Rovere and the Papal army in its various movements: he was in Bologna (May), Ravenna (June), Rome (August), Sinigaglia (November). Then, in March 1512, he went to Bloys, following orders from the Pope and the Duke of Urbino, to meet Louis XII. From May to October he participated in the campaign to regain Emilia.

