During the year of the Hudaybiya treaty, which was signed on Thul-Qi’da 4, 5 A.
During the year of the Hudaybiya treaty, which was signed on Thul-Qi’da 4, 5 A.H./March 27, 627 A.D. he also tried to assassinate the Prophet (S), but Allah, Glory to Him, foiled all his schemes, rendering them a failure, while supporting His Prophet on all occasions.
When Khalid came to know, as did other prominent members of Quraish, that the Messenger of Allah (S) was invincible, seeing how people were accepting the religion of Allah in large numbers, it was then that he surrendered to reality while suppressing his sighs. His acceptance of Islam, therefore, came as late as the eighth year after the Hijra (630 A.D., though some say it took place one year earlier, i.e.
in 629 A.D.), only four months before the conquest of Mecca which took place in 8 A.H./630 A.D. Khalid inaugurated his acceptance of Islam by behaving contrarily to the orders issued by the Messenger of Allah (S) not to kill anyone. Khalid entered Mecca on the conquest day after having killed more than thirty men who belonged mostly to Quraish although the Prophet had clearly instructed them not to kill anyone.
No matter how many excuses some people may find for Khalid by saying, for example, that he was banned from entering Mecca, and that they faced him with their weapons, he was not justified in killing anyone after having been prohibited by the Prophet from doing so; he could have gone to another gate to enter the city without a fight as others did, or to send a message to the Prophet seeking his advice with regard to those who were prohibiting him from entering. But none of that happened.
Rather, Khalid followed his own opinion, challenging what he had clearly heard from the Messenger of Allah (S).
Since we are talking about those who follow their own opinions at the expense of contradicting the available text, something which gained many supporters and enthusiasts, or say it acquired a school of its own from which many great sahaba and legislators graduated, a school which was later called the school of the caliphs, we cannot avoid pointing out here to the fact that ijtihad in such sense is nothing other than disobedience of Allah and His Messenger (S).
We have become accustomed to seeing references made to ijtihad versus the available texts, so much so that it appears as though it is perfectly legitimate. In fact, we have to say that Khalid disobeyed the Prophet's order instead of saying that he followed his own view in the face of an existing text.