Hadiths
The Messenger of God - may God’s prayers and peace be upon him - said: (Whoever treads a path in search of knowledge, God will make easy for him a path to Paradise).
The Messenger of God - may God’s prayers and peace be upon him - said: (Whoever God wants good for, He makes him understand the religion)
The Messenger of God - may God’s prayers and peace be upon him - said: (Seeking knowledge is an obligation upon every Muslim).
The Messenger of God - may God’s prayers and peace be upon him - said: (If a person dies, his work is cut off except for three: ongoing charity, beneficial knowledge, or a righteous child who
Islamic Creed The Names and Attributes of Allah in Islam 873 2026-09-12

How Can Allah Become Angry at Sin When He Already Knew It Would Occur?

Question
If Allah Almighty knows, before events occur, everything that His servants will do, how does He become angry with them when they commit sins and evil deeds? How should we understand His anger toward those who killed the prophets when He, Glorified be He, already knew beforehand that this would happen? And is there any specific authentic text stating that Allah became angry because of the killing of Yahya (John), peace be upon him?
Answer

 

Praise be to Allah, and peace and blessings be upon the Messenger of Allah. To proceed:

Allah’s prior knowledge of what His servants will do does not conflict with His loving obedience when it occurs or His anger at sin when it occurs. Allah has eternally known what will happen, and then the actions of His servants occur exactly as He knew they would. He loves those deeds and words that deserve His love, and He hates and becomes angry at those that deserve His hatred and anger.

As for the killing of Yahya, peace be upon him, the fatwa did not find any authentic hadith specifically stating that Allah became angry because of his killing.

Allah’s Knowledge Encompasses What Has Happened and What Will Happen

Allah, Glorified be He, knows all things before they occur, and nothing happens in the universe that was not already known to Him.

Allah Almighty says:

“And with Him are the keys of the unseen; none knows them except Him. And He knows what is on the land and in the sea. Not a leaf falls but He knows it, nor is there a grain in the darkness of the earth, nor anything fresh or dry, but it is written in a clear record.”

[Al-An‘am: 59]

And He, Glorified be He, says:

“No calamity occurs on earth or within yourselves except that it is in a Record before We bring it into existence.”

[Al-Hadid: 22]

Thus, Allah’s knowledge is not preceded by ignorance, nor is He surprised by the occurrence of something He did not know.

Does Anger Mean That Allah Was Surprised by the Sin?

No. This is an important point in understanding the issue.

Allah’s anger when a sin occurs does not mean that He only learned about it when it happened after previously being unaware of it, nor does it mean that He was surprised by what the servant did.

Allah already knew that the sin would occur. He knew who would commit it, when it would happen, and all its details before it occurred. Then, when the sin that warrants His anger occurs, He becomes angry with its perpetrator in a manner befitting Him, Glorified be He.

The same applies to obedience. Allah knows before it occurs that a servant will obey Him, yet He loves the servant and is pleased with him when the servant does what Allah loves and is pleased with.

Thus, there is a distinction between Allah’s prior knowledge of an action and what follows when that action actually occurs, such as love, pleasure, or anger.

The Quran Connects Allah’s Anger to the Actions of His Servants

Allah Almighty says:

“And they incurred anger from Allah. That was because they used to disbelieve in Allah’s signs and kill the prophets unjustly.”

[Al-Baqarah: 61]

Allah made their disbelief and their killing of the prophets among the causes of His anger toward them, even though these actions were not hidden from Him before they occurred.

And He, Glorified be He, says:

“O you who believe, do not take as allies a people with whom Allah is angry.”

[Al-Mumtahanah: 13]

The fact that Allah possesses prior knowledge does not negate the reality of the actions performed by His servants, nor does it negate the consequences of those actions, such as reward, punishment, love, or anger.

The Sunnah Affirms Allah’s Anger When Something That Warrants It Occurs

It is authentically reported from Abu Hurayrah, may Allah be pleased with him, that the Messenger of Allah ﷺ said regarding those who harmed the Prophet ﷺ on the Day of Uhud:

“Allah’s anger became severe against a people who did this to His Prophet.”

Narrated by al-Bukhari.

Allah, Glorified be He, knew before the Battle of Uhud what those people would do, yet the Prophet ﷺ informed us of the severity of Allah’s anger toward them because of their action.

Likewise, the Sunnah affirms Allah’s love for certain deeds and people and His hatred of other deeds and people, while His knowledge encompasses everyone’s actions before they occur.

Does Allah’s Prior Knowledge Force a Person to Commit Sin?

Allah’s knowledge that a person will do something is not what forces that person to do it.

A person acts through a will and choice that Allah has granted him, and for this reason he is held accountable for his choices.

Allah, Glorified be He, already knew what the servant would choose.

Knowing that something will happen does not mean forcing the person to do it.

Therefore, a person cannot use divine decree as an excuse for committing sin, because the sin was committed through his own choice, and he does not know what has been decreed for him before he acts.

What About Allah’s Anger Because of the Killing of Yahya, Peace Be Upon Him?

The fatwa did not find any authentic hadith specifically establishing that Allah became angry because of the killing of Yahya, peace be upon him.

Therefore, a particular hadith or report should not be attributed to the Prophet ﷺ without authentic evidence.

However, killing the prophets is among the gravest of crimes, and the Quran explicitly states that Allah became angry with certain peoples because of their disbelief and their unjust killing of the prophets, as Allah Almighty says:

“And they incurred anger from Allah. That was because they used to disbelieve in Allah’s signs and kill the prophets unjustly.”

[Al-Baqarah: 61]

As for specifically connecting the killing of Yahya, peace be upon him, to a particular report concerning Allah’s anger, this requires authentic evidence.

Conclusion

There is no contradiction between Allah’s prior knowledge and His anger when a sin occurs. Allah has eternally known what will happen, and then the servants perform their actions through their own choices. Allah loves obedience and is pleased with it, and He hates sin and becomes angry with those who deserve His anger.

Allah’s anger does not mean that He acquired new knowledge or was surprised by the action. Rather, His knowledge is perfect and precedes all things, while His anger is an established attribute of His in a manner befitting His Majesty.

As for the claim that there is a specific text concerning Allah’s anger because of the killing of Yahya, peace be upon him, this has not been authentically established according to what the fatwa found. Therefore, nothing should be attributed to the religion without authentic evidence.

And Allah knows best.