Hammurabi extended his empire northward from the Persian Gulf through the Tigris and Euphrates river valleys and westward to the coast of the Mediterranean Sea by wars. After consolidating his gains under a central government at Babylon, he devoted his energies to protecting his frontiers and fostering the internal prosperity of the empire.