 Luni had been reduced to a small village by the time of the Lombard king Liutprand.Later, it was a countship and see under Charlemagne, exactly on the border between the Kingdom of Italy and the Papal States.It was repeatedly sacked by sea pirates, Saracens in 849 and Vikings who settled in 860.