Gorizia was officially mentioned for the first time on 28th April 1001; in a document in which the emperor Otto III donated the castle of Salcano (Sylicanum, in Latin) and the "villa un manero", called "Goritia" (from the Slavic diction "gorica", that is "montagnola") half to the Patriarch of Aquileia, and the other half to the Count of Friuli Guariento of the Eppenstein family. This double attribution was always a cause of friction between Gorizia and Aquileia.
The term "villa" suggests that at the time there was still no castle on the hill, although for many historians it is very likely that there were fortifications (perhaps a watchtower) on the hill, it is widely believed that a real manor was built from the twelfth century. Gorizia faces the "official" history and documented after a tragic century, characterized by the cruel invasions of the Hungarians who not only plundered Friuli, but also impoverished it to such an extent as to unhinge any trace of established order. Added to this were the spiritual anxieties of a millennium that was about to end under the most sinister auspices synthesized by the fear of the end of the world: "A thousand and not a thousand". "After five decades of devastation, the Friulian historian Mor-la Marca presented himself as a pile of ruins, in a desolate and depopulated land. In 955 the emperor Otto I defeated the Hungarians definitively in a great battle near Augsburg, in Bavaria, which posed the problem of the safety of the territory of the Marca and its rebirth. Emperor Ottone I began the so-called "incastellamento" of Friuli: the Germanic emperors provided for an administrative reorganization of the whole area entrusting the various villas and territories to their faithful vassals who, obeying the imperial directives, erected numerous fortifications, destined to become the hundreds of castles that still today embellish Friuli-Venezia Giulia. The origins of the dynasty of the Counts of Gorizia are not completely clear. The possession of the Gorizia area remained in the hands of the Eppenstein family until this dynasty was called to govern the Carinthian dukedom (in 1090), and then became extinct between 1122 and 1125.