The Brhadaranyaka Upanishad, in the verse 1.4.14, describes the creation of dharma, which is righteousness and justice. Here’s a translation of the verse:
“Yet, he [the Brahman, the prime author of the universe] was not flourishing. So he created on himself another excellent form, which is the form of dharma. This dharma is the power and duty of the kshatriya class (ruling class) and hence there is nothing better than dharma. Through dharma, a weak man might overcome a strong man, as one does through a king. That which is dharma is the truth. Thus it is said by those who speak the truth: “He speaks dharma” and “He speaks truth”—both statements have the same meaning.”
This verse denotes the supremacy of rule of law. All kings (all kshatriyas who enjoy political power) must be subordinate to dharma. The Brahman was concerned that the kshatriya class, being fierce, might become unruly and start oppressing the masses. That is why he created the excellent form of dharma which would motivate the kshatriyas to serve as the righteous and truthful defenders of rule of law. Dharma enjoins the powerful to use their power for the good of everyone by implementing the divine law.
Satya (truth) and dharma (righteousness and justice) are organically related. When there is dharma, there is truth; when dharma fails, there is a regime of adharma (injustice) and asatya (lies).