The Habsburg family line were emperors of the Holy Roman Empire from 1438 to 1806, and emperors of Austria from 1804 to 1918. The family is of Swiss origin, and its earliest seat is the Habsburg, a castle not far from Aarau in Canton Aargau. The Habsburgs were already a powerful family in the 10th c. and possessed extensive lands. Count Rudolf was elected German King (see Rudolf I) in 1273, and acquired the duchies of Austria and Styria through his victory over Ottokar II of Bohemia in 1278. Rudolf's grandson failed to secure election, and the control of the Empire passed to the Luxemburg family. In the 14th c. revolts deprived the Habsburgs of their Swiss territories. From Albrecht II until the end of the Holy Roman Empire the imperial dignity was virtually hereditary in the Habsburg dynasty. By astute political marriages the family became the most powerful in Europe.