The city of Amalfi was founded as a trading post in 339. Its first bishop was appointed in 596. In 838, the city was captured by
Sicard of Benevento with help from traitors within the city, who led him in through the waterward defenses. Many of the Amalfitans in
Salerno sacked that city and left. In 839, Amalfi freed itself from
Lombard domination and elected a
prefect. Nearby
Atrani participated in these early prefectural elections. 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 914, the prefect
Mastalus I was appointed first
judge. In 903 the Amalfitans joined forces with Naples to attack the Arabs that had established themselves on the banks of the
Garigliano river. However the combined forces of Amalfi and the Naples were driven back by the Arabs and their allies, the Italian city state of
Gaeta. In 915 Amalfi did not join the
Battle of Garigliano to fight against the Arabs. This was most likely because since 909 Amalfi had been heavily trading with the
Fatimid Caliphate and did not want to jeopardize relations with this powerful trade partner. In 958,
Mastalus II was assassinated and
Sergius I was elected first
duke (or
doge). From 981 to 983, Amalfi ruled the
Principality of Salerno. In 987, the
Amalfitan bishopric was raised to archiepiscopal status. From 1034, Amalfi came under the control of the
Principality of Capua and, in 1039, that of Salerno. In 1073,
Robert Guiscard conquered the city and took the title "duke of the Amalfitans". In 1096, Amalfi revolted, but this was put down in 1101. 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. In 1135 and 1137, Pisa sacked the city and the glory of Amalfi was past. The Arab traveller
Ibn Hawqal, writing in 977 during the great reign of
Manso I, described Amalfi as: The title "Duke of Amalfi" was revived in the later 14th century as a title used within the
Kingdom of Naples. == Importance ==