In Shakymuni's day, the kings of the city states became famous as the patrons of the newly founded religious orders. For example, King Ashoka (3rd century BC) of the Maury dynasty became a paradigm of a Dharma King. He made it an overriding purpose of his rule to support religious people in general and especially the Buddhist community.
In many Buddhist countries since then, kingship has drawn its legitimacy from the ruler's patronage of the people's spiritual pursuits. The Buddhist ideal of Dharma kingship is clearly conveyed by the Buddhist custom that, although such a king or queen is the most honored and most powerful figure in society, he or she should bow down to the simplest monk or nun, signifying the superiority of the sacred over the mundane.
Certain Dharma Kings, some worldly, some mythical, and some heavenly, are especially famous in Tibetan Buddhism as protectors of the Dharma, the Buddhist teachings. The most famous of the mythical Kings is Gesar.
Known as Gesar of Ling, Gesar is a Tibetan national hero who fights for his people against all sorts of enemies, though, the cycle of tales has absorbed Buddhism so completely that Gesar's defense of Tibet against the forces of evil becomes a drama of defense of the Buddha Dharma.