thumb|upright|Coat of arms of [[Ulrich II, Count of Celje|Ulrich II of Celje]]
thumb|right|Territory of Counts of Celje in mid-15th century
The Counts of Celje () or the Counts of Cilli (; ; ) were the most influential late medieval noble dynasty on the territory of present-day Slovenia. Risen as vassals of the Habsburg dukes of Styria in the early 14th century, they ruled the County of Cilli as immediate counts (Reichsgrafen) from 1341. They soon acquired a large number of feudal possessions also in today's Croatia and Bosnia. They rose to Princes of the Holy Roman Empire in 1436. The dynasty reached its peak with Ulrich II of Cilli, but with his death in 1456 they also died out, and after a war of succession, the Habsburgs inherited their domains.
History
thumb|Celje Castle
The Lords of Sanneck (Žovnek) Castle on the Sann (Savinja) river in Lower Styria were first mentioned around 1123/30. Their ancestors may have been relatives of Saint Hemma of Gurk (d. 1045), who held large estates in the area. The fortress was allegedly already built under the rule of Charlemagne as a stronghold against the Avars.
Counts
One Leopold of Sanneck appeared as a supporter of the Habsburg king Rudolf I of Germany in the 1278 Battle on the Marchfeld. In the early 14th century, the Lords of Sanneck allied with the Austrian Habsburgs in their conflict against Duke Henry VI of Carinthia around the Kingdom of Bohemia, making them Habsburg vassals in 1308. Leopold's brother Frederick by marriage inherited the large possessions of the late Counts of Heunburg in 1322; the Celje estates became a property of the dynasty in 1333, Through Barbara of Cilli the Counts were also in kinship with the royalty of Bohemia.
Imperial princes
Their rapid rise continued after the 1396 Battle of Nicopolis against the Ottoman Empire, where Count Hermann II of Cilli saved the life of King Sigismund of Hungary, the son of the late Emperor Charles IV. As a reward, the king donated (1397–99) the city of Varaždin, the county of Zagorje, Međimurje region and many estates in Croatia to the family.
