There is little known of the Friuli prior to Roman times. The region's Latin name, when it was the home of the Tenth Roman Legion, was Patria Fori Julii, from which the name "Friuli" derives. Its early history was extremely turbulent, as it was conquered by the Huns, by Charlemagne, by the Lombards, and by the Magyars. In the mid-900s it had become a sovereign state under the aegis of King Henry IV of Germany. In the mid-1700s this sovereign status was dissolved because of internal dissension, and in 1797 Napoleon occupied the region. The Friuli parliament, established in 942, met for the last rime in 1805. From 1814 to 1866, Friuli became a part of Austria. When the kingdom of Italy was proclaimed in 1866, however, Friuli voted to join it. In the early 1900s, Friuli once again but only briefly became a part of Austria, to be returned to Italy in 1919 with the collapse of the Hapsburg Empire and the Treaty of Saint Germain. After World War II, portions of traditional Friuli territory were lost to Yugoslavia, while the major part of the region remained in Italy's hands.