Question:
What is the ruling on swearing an oath to do something impermissible, and what is the ruling on fulfilling it?
Answer:
Swearing an oath to do something impermissible is also impermissible. However, if someone has sworn such an oath, it is obligatory to break it, and in the case of breaking it, he must also pay the expiation.
❀ Sayyiduna Abd al-Rahman bin Samurah (may Allah be pleased with him) narrates that the Messenger of Allah ﷺ said:
إذا حلفت على يمين ورأيت غيرها خيرا منها فأت الذى هو خير وكفر عن يمينك .
“When you swear an oath to do something, then (you) see another thing that is better than it, do the better thing and give the expiation for your oath.”
When an oath has been sworn to do a permissible thing, and it later becomes known that the other course of action is better, one should break the oath and do the other thing. So as for an oath that was sworn to do something impermissible in the first place, changing it is not only correct, but also obligatory.