Utu / Šamaš, the Sun-God of Justice
Nothing hides from the sun — so the god who sees all became the judge of all.
Also: Utu · Shamash · Šamaš · sun god · Sippar · god of justice · Babbar
Because the sun looks down on everything, the sun-god Utu — Shamash in Akkadian — became the great god of justice. He sees what is hidden, exposes the liar, upholds the oath, and protects the traveller, the widow, and the orphan. Kings present their law collections as given under his authority; on the famous stele the Laws of Hammurabi are shown received from Shamash. He is also the god invoked in divination, since the one who sees all can answer the diviner's question about what is true and what will come.
In short
The sun-god Utu (Sumerian) / Šamaš (Akkadian), who sees all things by day and is therefore the divine judge, guarantor of oaths, law, and the rights of the weak.
Where it’s found
Pervasive in hymns and in royal-law prologues; the Laws of Hammurabi prologue/epilogue invoke Šamaš (akkadian-pending); Sumerian Utu hymns and proverbs (in corpus)
How the idea developed across Sumer, Babylon & Assyria
Utu of Sippar and Larsa and Akkadian Šamaš are syncretized across the strata. His justice role deepens over time: by the Old Babylonian period he is the patron of the law collections and, with Adad, the chief god of extispicy and oath.