Answered by our Shaykh, the ‘Allāmah, the Trustworthy Advisor, Abu ‘Abdirrahman Yahya bin ‘Ali Al-Hajūri – may Allah preserve him – on the 24th, Rajab, 1422H
What does one do if one had to cross over graves to reach the Masjid?
If one was not able to find a way to the Masjid besides having to walk over the graves, and this was inescapable. Then for a person to pray in his house is Awlā has more priority than to walk over graves.
Our proof for this is the Hadīth of the Messenger of Allah ﷺ in the two Sahīhs:
“ما أمرتكم به فأتوا منه ما استطعتم، وما نهيتكم عنه فاجتنبوه”
“Whatever I command you with, do as much as you’re able to, whatever I forbid you from, abstain from it”
The people of Usūl took from this Hadīth that (abstaining from) prohibition is preceded upon commands (to perform), due to the statement of Allah, Exalted is He:
“فَلْيَحْذَرِ الَّذِينَ يُخَالِفُونَ عَنْ أَمْرِهِ أَنْ تُصِيبَهُمْ فِتْنَةٌ أَوْ يُصِيبَهُمْ عَذَابٌ أَلِيمٌ“
“And let those who oppose his Prophet Muhammad ﷺ commandments beware, lest some Fitnah befall them or a painful torment be inflicted on them.” [An-Nūr:63]
Commandments (here) is broader than commandments and prohibitions, what’s intended is that commandment and prohibition enters into this, (his Prophet Muhammad ﷺ commandments) i.e: his way.
Adding to this what has been established with authentic clearcut evidences, regarding the prohibition of walking upon graves or treading upon it, on the authority of Abu Hurayrah in Sahih Muslim.
Translated by : Abu ‘Abdirrahman ‘Abdullaah bin Ahmed Ash-Shingaani
Original Fatwa: الكنز الثمين في الإجابة على أسئلة طلبة العلم والزائرين 3
Entitled:حكم الذهاب إلى المسجد إن كان الطريق على قبور