It was given to Adelchis to preserve the ancient principality and its independence in the face of repeated assaults by the Saracens from the south, the Emperor Louis II from the north, and ByzantineLangobardia to the east. At first, he was unsuccessful in his wars with the Muslims. He was defeated at Bari in 860 and forced to make a truce with the emir and pay a tribute. In subsequent ventures, he was forced to call on the help of the emperor. In 866, the emperor defeated the Saracens and, in 871, Bari itself fell. Louis then tried to set up greater control over all of the south by garrisoning his troops in Beneventan fortresses.
The response of Adelchis to this action was to imprison and rob the emperor while he was staying in the princely palace at Benevento in August—a treachery lamented in a contemporary poem, the Rythmus de captivitate Ludovici imperatoris. A month later, the Saracens had landed with a new invasive force and Adelchis released Louis to lead the armies against it. Adelchis forced Louis to vow never to reenter Benevento with an army or to take revenge for his detention. Louis went to Rome in 872 and was released from his oath by Pope Adrian II on 28 May. He tried to exact punishment on Adelchis, but was not very successful. Adelchis turned to the Byzantines. He was assassinated in May 878.
He was notably the last Lombard ruler to revise the Edictum Rothari.