The code of chivalry that developed in medieval Europe had its roots in earlier centuries. It arose in the Carolingian Empire from the idealization of the cavalryman, involving military bravery, individual training, and service to others, especially in Francia, among horse soldiers in Charlemagne's cavalry.