Gilgamesh was

a king of a city-state in Egypt.

the hero in a popular Mesopotamian epic.

a pharaoh in conflict with the city of Kish.

the legendary loyal friend of King Tut.

All these answers are correct.