as the Prophet, peace and blessings be upon him, said to al-‘Abbās: “Outwardly, you were against us; as for what is in your heart, that is for Allah to judge.”
Al-Bukhārī and Muslim both narrated in their Sahīh collections, on the authority of Ibn ‘Umar, that the Prophet, peace and blessings be upon him, said: “When Allah sends punishment upon a people, it strikes everyone among them; then they will be resurrected according to their intentions.” This too demonstrates that someone compelled to swell the ranks of those fighting unjustly—even if punishment befalls him in this world—will be resurrected in the Hereafter according to his intentions.
All of this shows that not everyone compelled to commit a forbidden act incurs sin thereby. This accords with the better-known of the two reported views and is the position of the majority of scholars.
An example of this is Muslims remaining among the polytheists in a state of powerlessness. The Quran provides evidence for both this and that.
Another example is a Muslim surrendering himself as a captive when a disbeliever compels him, saying: “If you do not surrender, I will kill you.” Entering his captivity would be forbidden were it not for the coercion. Khubayb ibn ‘Adī and others did this, and in such circumstances they are like those who are powerless.