Killing of the prophets, the messengers and the righteous people is as old as the creation of the human being itself. We all know the story of Adam's son killing his righteous brother. Only the naive among us think that the bad people are permitted to be killed by God Almighty, while the other good ones are permitted to die naturally. When the Jews thought that they killed Jesus on the cross, they used this incidence to claim that Jesus cannot be a prophet of God since they were able to kill him. Again this reflects their misunderstanding of the system that God Almighty established on earth. On the contrary, some people believe that since Jesus escaped his killing, then there is a proof that the prophets and messengrs of God will not have their life terminated by a killer.
Everyone of us have a life span that will end at a predetermined time. Only God decides and knows when everyone's life ends. If the whole world got together and decided to kill someone. he/she will not be killed unless it was the time for his/her life to be over and God let them do it. If you hide in a formidable castle to avoid being killed or to run away from death, nothing will save your life when it is your time to go.
[4:78] Wherever you are, death will catch up with you, even if you live in formidable castles......
Also, it is God who knows how your life will end, in a natural death, by aging, by a disease, by a car accident, by a gun shot wound , a stab wound , burn in a fire, in an airplane crash, eaten by sharks or by other human cannibals. It does not make a difference, it is all death and has nothing to do with how righteous you have been. These decisions go back to God.
When the Prophet Muhammed was alive, God could have told him how his life will come to an end, but He did not . On the contrary, God made it so vague, no one could have predicted how the Prophet Muhammed would die. If it was the rule that the prophets and/or messengers do not get killed, God would not have told Muhammed that he may die or get killed.
[3:144] Muhammed was no more than a messenger like the messengers before him. Should HE DIE OR GET KILLED, would you turn back on your heels?..
Muhammed suffered from fever and unknown disease before his death, according to history books, and died at 63 years of age. God could have saved him the suffering, the weakness and loss of control that comes with sickness, but God wants us to know that he is a human being like us, who would go through everything we go through.
Other messengers and prophets have different fate. God told us repeatedly in the Quran that He sent many prophets and messengers and this was one of His blessings for the people. Some of these prophets and messengers lived and died naturally and God did not mention anything about their life or death and some others were killed. God made it special to tell us that these messengers and prophets were killed and did not die naturally. God does not mention anything in the Quran unless He wants us to take NOTION. God could have stopped the killing of these prophets and messengers of His, but He did not.
Prophets and Messengers are human beings like us and are subject to the same fate we are subjected to. They may die naturally or get killed. Their killing is not an indication of them being rejected by God or being any less than other messengers or prophets. It was the way God, not the people , who chose to terminate their life in this way.
[2:87] We gave Moses the scripture, and subsequent to him we sent other messengers, and we gave Jesus, son of Mary, profound miracles and supported him with the Holy Spirit. Is it not a fact that everytime a MESSENGER went to you with anything you disliked, your ego caused you to be arrogant ? Some of them you rejected, and some of them you KILLED.
[5:70] We have taken a covenant from the Children of Israel, and we sent to them messengers. Whenever a MESSENGER went to them with anything they disliked, some of them they rejected and some they KILLED.
[2:61] ......... They have incurred condemnation, humiliation and disgrace, and brought upon themselves wrath from God. This is because they rejected God's revelation, and KILLED the PROPHETS unjustly. This is because they disobeyed and transgressed.
See also, 3:112 and 5:70
The savage killing of prophet John (Yahia) is well documented in the Bible. Our Muslim history is not free of this kind of atrocity where righteous people were killed SUPPOSEDLY in the name of God. Omar Ibn Al-Khattab, the second Khalifa to rule the Islamic State was killed, supposedly, in the name of God during his reign. Othman Ibn Affan , the third Muslim Khalifa was killed, supposedly, in the name of God during his reign. Ali Ibn Abu Talib, the fourth Muslim Khalifa was also, supposedly, killed in the name of God.
All these killings were committed, supposedly, in the name of God when it has nothing to do with God, and it was in reality in the name of Satan. All these killings could have been stopped by God, if killing of righteous people is not supposed to happen. But these people have their life coming to an end according to God's plan. No one could have ended their life ahead of time or surprised God and took their life away. They were not killed because they were bad people but because they were good ones.
So, for the naive person who thought the death of a person by killing is only for the bad people, a sincere look at the Quran will clarify that.
Our generation was lucky enough to witness the same phenomenon and be blessed by sending the messenger of the covenant, as promised in 3:81. The killing of the late Dr. R. Khalifa, who proclaimed and proved to be the messenger of the covenant prophesied in 3 :81, in 1990, was not because the enemies of God were smarter than God or did their Job faster than God .but because his life was over . It was not because he asked the people to worship him or follow him but because he told the people to uphold the true Islam (Submission), discard the false Islam built on tradition and go back to worship God Alone and follow Quran Alone. His message was completely delivered as far as God is concerned. The message was loud, clear, strong and unambiguous, follow Quran ALONE and worship God ALONE. His life was then over, like many of the other prophets and messengers who were killed, according to God , not according to the followers of Satan. Surely, we can now see a new generation of Muslims (Submitters) who insist on cleaning, purifying and clarifying the universal message of Islam (Submission) to the whole world. Islam (Submission) is born again, cleaner, clearer, stronger, and compassionate towards all human beings. God promised and his promise is clearly happening. He put His promise in the Sura called Muhammed and in the Verse number 38. ( that they may take heed !!)
[47:38] ...If you turn away, He will substitute other people in your place, and they will not be LIKE YOU.