the southeast, moved in after the retreat of the Lombards to Italy in 568 (see Slavic settlement of Eastern Alps). From 623 to 658 Slavic peoples between the upper Elbe River and the Karawanks mountain range united under the leadership of King Samo (Kralj Samo) in what was to become known as "Samo's Tribal Union". The tribal union collapsed after Samo's death in 658, but a smaller Slavic tribal principality, Carantania (Slovene: Karantanija), remained, with its centre in the present-day region of Carinthia. Alpine Slavs during the Frankish Empire Faced with the pressing danger of Avar tribes from the east, the Carantanians accepted a union with Bavaria in 745, and later in the 8th century recognized Frankish rule and accepted Christianity. The last Slavic state formation in the region, the principality of Prince Kocel, lost its independence in 874. Slovene ethnic territory subsequently shrank due to pressure from Germans from the west and the arrival of Hungarians in the Pannonian plain; it stabilized in its present form in the 15th century. 16th century: Slovene Protestant reformation and consolidation of Slovene The first mentions of a common Slovene ethnic identity, transcending regional boundaries, date from the 16th century. During this period, the first books in Slovene were written by the Protestant preacher Primož Trubar and his followers, establishing the base for the development of standard Slovene. In the second half of the 16th century, numerous books were printed in Slovene, including an integral translation of the Bible by Jurij Dalmatin. At the beginning of the 17th century, Protestantism was suppressed by the Habsburg-sponsored Counter Reformation, which introduced the new aesthetics of Baroque culture. 18th century: Slovenes under Maria Theresa and Joseph II The Enlightenment in the Habsburg monarchy brought significant social and cultural progress to the Slovene people. It hastened economic development and facilitated the appearance of a middle class. Under the reign of Maria Theresa and Emperor Joseph II (1765–1790) many reforms were undertaken in the administration and society, including land reforms, the modernization of the Church and compulsory primary education in Slovene (1774). The start of cultural-linguistic activities by Slovene intellectuals of the time brought about a national revival and the birth of the Slovene nation in the modern sense of the word. Before the Napoleonic Wars, some secular literature in Slovene emerged. During the same period, the first history of the Slovene Lands as an ethnic unity was