 Prince Atenulf I conquered Benevento in 900 and united the principalities until 981, when Pandulf Ironhead separated them in his will for his children.Capua eclipsed Benevento thereafter and became the chief rival of Salerno.Under Pandulf IV, the principality brought in the aid of the Normans and, for a while had the loyalty of Rainulf Drengot, until the latter abandoned him to aid the deposed Sergius IV of Naples take back his city, annexed by Pandulf in 1027.