Hammurabi, king of Babylon from 1792 to 1750 B.C., expanded and consolidated his kingdom, changing it from a small city-state into a territory covering most of Mesopotamia. He is best known for the so-called Code of Hammurabi, a collection of precedents and new laws. The influence of this code extended for many centuries, as surviving copies attest; one copy, dating to the seventh century B.C., was found in the library of Assurbanipal.