In 840, ancient Capua was burned to the ground by a band of Saracens, with only the church of S. Maria Maggiore remaining untouched. The population escaped on the mount Tifata, where founded a temporary camp, called Sicopoli.
After some years, some Capuans came back to where was locate the ancient Capua to live near the intact church of S. Maria Maggiore.
Another part founded a new city in 856, but at some distance from the former site, where there was the Roman village called Casilinum. Here the bishop of Capua moved his residence and decided to rename Casilinum in Capua.
During the Middle Ages, Capua became an important principality. In 900, prince Atenulf I conquered Benevento and became the chief rival of Salerno for the control of the region.
In 978, prince Pandulf Ironhead conquered Salerno and unified all the Longobard territories in the southern Italy. In 1156 the principality was united to the kingdom of Sicily.