The city and its territory were originally part of the larger ducatus Neapolitanus, governed by a patrician, but it extracted itself from Byzantine vassalage and first elected a duke (or doge) in 958.
[1] It rose to become an economic powerhouse, a commercial center whose merchants dominated Mediterranean and Italian trade in the ninth and tenth centuries, before being surpassed and superseded by the other maritime republics of the North and the Centre: Pisa, Venice, Genoa, Ancona and Gaeta.
Subsequently, Amalfi helped to free Siconulf to oppose the ruling Prince of Benevento.
In 897, the self-governing republic, still nominally tied to the Byzantine Empire, was defeated in a war with Sorrento, supported by Naples, in which her prefect was captured, later ransomed.
In 903 the Amalfitans joined forces with Naples to attack the Arabs that had established themselves on the banks of the Garigliano river.
[2] However the combined forces of Amalfi and the Naples were driven back by the Arabs and their allies, the Italian city state of Gaeta.
It revolted again in 1130 and was finally subdued in 1131, when the Emir John marched on Amalfi by land and George of Antioch blockaded the town by sea and set up a base on Capri.
[1] The Knights Hospitaller, a Catholic military order that was active during and after the Crusades, was founded by Benedictine monks from Amalfi and used the duchy's eight-pointed cross as one of its symbols.