The Emperor Henry II officially granted the principality to Pandulf V in 1023 and associated his son John with him as co-prince.
In 1024, at the behest of Guaimar III of Salerno, Emperor Conrad II released Pandulf IV.
Guaimar and Pandulf promptly besieged Capua with the help of the Norman mercenary Rainulf Drengott.
In 1025, the Byzantine catapan Basil Boioannes, who had been busy on a Sicilian expedition, joined them with a giant force.
In 1026, after an 18-month siege, Boioannes negotiated Pandulf V's surrender and granted him and his son John safe conduct to Naples.