Monaco's name comes from the nearby 6th-century BCE Phocaean Greek colony. Referred to by the Ligurians as Monoikos, from the Greek "μόνοικος", "single house", from "μόνος" (monos) "alone, single" + "οἶκος" (oikos) "house", which bears the sense of a people either settled in a "single habitation" or of "living apart" from others.
According to an ancient myth, Hercules passed through the Monaco area and turned away the previous gods. As a result, a temple was constructed there, the temple of Hercules Monoikos. Because the only temple of this area was the "House" of Hercules, the city was called Monoikos. It ended up in the hands of the Holy Roman Empire, which gave it to the Genoese.