During the late 1630s, Pope Urban and his Barberini nephews came into conflict with the Farnese Dukes of Parma sparking the conflict known as the First War of Castro. In 1641, Mattei was appointed "Lieutenant General" of the papal armies and was accordingly given a monthly salary of 343 scudi. On 12 October he led 12,000 infantry and 3,000 cavalry against the fortified town of Castro which was under the control of the Farnese. Though it is estimated that the Farnese had amassed a similarly sized army, Mattei's forces were met with very little resistance and the town was forced to surrender. Mattei's victory at Castro was immortalised in song by Marco Marazzoli.