The territory which later came to be called Hungary was generally Roman-occupied from 15 BC to circa AD 378. It contained Celtic tribes such as the Hercuniates, Eravisci, and Anarti, and largely formed the province of Pannonia. In the late third and early fourth century various other tribes infiltrated it, including the Germanic Rugii. Then the Huns swept through Eastern Europe and dominated this area until AD 427. The Western Roman empire briefly recaptured it until the Huns once more took control circa 445. They were followed by the new power in southern and eastern Europe, the Ostrogoths, around 460, but as they migrated into the Balkans the area became tribal from about 488-558.
Elements of the surviving Huns had settled nearby, and until relatively recently it was generally thought that it was their name that was applied to the region in the form of Hungary (but see the kingdom of Hungary, below, for a more detailed investigation), while Germanic tribes such as the Gepids also occupied northern and eastern areas of it, close to the Carpathians. The Avars swept in from the Steppes to control the region from 558-803, but there was a break in their rule in the seventh century. Eventually they were superseded by another wave of Asiatic horsemen called the Magyars, and their arrival signalled the creation of a state that became modern Hungary.
Slovakia was never a kingdom in its own right. For most of its history (906-1918) it was part of Hungary. Then it was attached to former Bohemia-Moravia to form the republic of Czechoslovakia. In-depth study of Hungarian history is often difficult as the most detailed literature is only available in the Hungarian language and remains practically unknown outside the country's borders.