In the medieval history of Europe, Bulgaria's status as the Bulgarian Empire (, Balgarsko tsarstvo ) occurred in two distinct periods: between the seventh and the eleventh centuries and again between the twelfth and the fourteenth centuries. The two "Bulgarian Empires" are treated not as separate entities but rather as one state that was restored after a period of Byzantine rule over its territory. First Bulgarian Empire Moesia was repeatedly invaded by both Slavs and Bulgars during the 5th, 6th and 7th centuries. In 499, the Bulgars crossed Danube and reached Thrace where on the banks of the river Tzurta (considered a tributary of Maritsa) defeated 15,000 men strong Roman army led by magister militum Aristus. In the 670s under the rule of Asparukh the Bulgars settled further south on territories of the Eastern Roman Empire in Scythia Minor near the Danube Delta in a region called Ongal and allied with the local Slavs. Their horde was a remnant of Old Great Bulgaria, an extinct tribal confederacy or rudimentary state situated north of the Black Sea in what are now parts of Ukraine and Russia. There was a major battle between Asparukh and the Byzantine Emperor in Moesia in 680. A peace treaty with the Byzantine Empire was signed in 681, marking the foundation of the First Bulgarian Empire on the territory both north and south of the lower course of the Danube River as an alliance between the ruling Bulgars and the numerous Slavs in the area, becoming the oldest still existing Slavic state. The minority Bulgars formed a close-knit ruling caste. It is usually described as having lasted between 681 and 1018, when it was subjugated by the Byzantine Empire despite Emperor Samuel's fierce resistance. Tervel of Bulgaria, son of Asparukh, was the ruler at the beginning of the 8th century. In 705, Emperor Justinian II named him Caesar, the first foreigner to receive this title. Tervel played an important role in defeating the Arabs during the Siege of Constantinople in 717–718. During Krum’s reign in the early 9th century, Bulgarian territory doubled in size, spreading from the middle Danube to the Dnieper and from Odrin to the Tatra Mountains. His able and energetic rule brought law and order to Bulgaria and developed the rudiments of state organization. Bulgaria gradually reached its cultural and territorial apogee in the 9th century and early 10th century under Prince Boris I