All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah and that Muhammad, sallallaahu ʻalayhi wa sallam, is His slave and Messenger.
Haamaan was mentioned several times in the Quran along with Pharaoh, and they were also both mentioned with their soldiers. The Quran clearly states that Allaah, The Exalted, sent Prophet Moosa (Moses) to Pharaoh and Haamaan but that they disbelieved in him; therefore, Allaah destroyed them. The Quran also states that Pharaoh ordered Haamaan to build the high structure or tower referred to in the verse that reads (what means): {And Pharaoh said, “O eminent ones, I have not known you to have a god other than me. Then ignite for me, O Haman, (a fire) upon the clay and make for me a tower that I may look at the God of Moses. And indeed, I do think he is among the liars.”} [Quran 28:38]
Allaah, The Exalted, also says (what means): {And We did certainly send Moses with Our signs and a clear authority to Pharaoh, Haamaan and Qaaroon; but they said, “(He is) a magician and a liar.” And when he brought them the truth from Us, they said, “Kill the sons of those who have believed with him and keep their women alive.” But the plan of the disbelievers is not except in error.} [Quran 40:23-25]
He also says (what means): {And the family of Pharaoh picked him up (out of the river) so that he would become to them an enemy and a (cause of) grief. Indeed, Pharaoh and Haamaan and their soldiers were deliberate sinners.} [Quran 28:8]
Allaah, The Exalted, says about their destruction after disbelieving in Prophet Moosa (what means): {And (We destroyed) Qaaroon and Pharaoh and Haamaan. And Moses had already come to them with clear evidences, and they were arrogant in the land, but they were not outrunners (of Our punishment). So each We seized for his sin; and among them were those upon whom We sent a storm of stones, and among them were those who were seized by the blast (from the sky), and among them were those whom We caused the earth to swallow, and among them were those whom We drowned. And Allaah would not have wronged them, but it was they who were wronging themselves.} [Quran 29:39-40]
This indicates that there was a strong relationship between Pharaoh and Haamaan, who was following the orders of Pharaoh. As for whether Haamaan was the vizier, deputy, or commander of Pharaoh’s army and whether this was his real name or a title related to his job, researchers held different opinions in this regard. In fact, we could not find any clear text in this regard. We advise you not to preoccupy yourself with this matter. Rather, you should preoccupy yourself with learning and studying the divine revelation (Quran and Sunnah); verily, this is more beneficial to you than preoccupying yourself with such matters of which knowing them is not of great benefit and being ignorant of them is not harmful.
Allaah knows best.