Between 1639 and 1649, the Pamphili fought the Wars of Castro alongside the Barberini against the Farnese dukes of Parma who controlled Castro and its surrounding territories. The conflict raged first under Barberini Pope Urban VIII and later under Pamphili Pope Innocent X.