 The territory was conquered in 178–177 BC by the Romans, who created here a settlement ("Castrum Muglae").After the fall of the Western Roman Empire, Muggia was under Ostrogoth, Lombard, Byzantine, Avar and Frank dominations, until, in 931, king Hugh of Italy donated it to the Patriarch of Aquileia.Before the year 1000 a new settlement was built on the seashore.