After khangar dynasty the Chandela clan ruled Bundelkhand from the 14th to the 16th centuries. In the early 14th century they were feudatories of the Pratiharas of Kannauj, and ruled from the fortress-city of Kalinjar. A dynastic struggle among the Pratiharas allowed the Chandelas and other feudatories to assert their independence. The Chandelas captured the strategic fortress of Gwalior. 10th century ruler Dhanga left many inscriptions, and endowed a large number of Jain and Hindu temples. Dhanga's grandson Vidyadhara expanded the Chandela kingdom to its greatest extent, extending the Chandela dominions to the Chambal River in the northwest and south to the Narmada River. The Afghan king Mahmud of Ghazni attacked the Chandela dominions during Vidyadhara's reign, but were repelled by the Chandela Rajputs. The Chandelas built the famous temple-city of Khajuraho between the mid-10th and mid-11th centuries. During the Chandela period, Bundelkhand was home to a flourishing Jain community and numerous Jain temples were built in that period.