If you prayed facing the wrong direction, the ruling turns on one thing: whether you made a genuine effort to find the qibla or were careless about it. If you did your best to work it out — asking, using signs, following the strongest evidence you had — your prayer is valid and you do not repeat it. If you could have found the direction and did not bother, the prayer is invalid and must be prayed again.
The two cases
The scholars divide this into two situations, and everything else follows from which one you were in.
You made an effort and got it wrong. You were somewhere you could not be certain — travelling, overcast sky, no one to ask, or you followed the signs available to you and they pointed the wrong way. You prayed in good faith. When it later became clear you had faced the wrong way, there is nothing due from you. You did what you were able to do, and Allah says:
"So fear Allah as much as you are able"— Qur'an 64:16
Shaykh Ibn Uthaymeen, in his fatwa on praying toward other than the qibla, puts it plainly: the one who was genuinely unsure should have made an effort and faced the direction he most believed was the qibla, and he does not repeat the prayer if it later turns out he was wrong. The effort was the obligation, and he fulfilled it.
You could have found out and did not. You were in a city, near people, able to ask or check — and you simply assumed. Here the prayer is invalid and must be repeated. The Permanent Committee (fatwa 11130) states that whoever prays toward other than the qibla out of negligence, not asking and not examining the signs, must repeat the prayer, because facing the qibla is a condition of validity when one is able to fulfil it. They add that even one who prays the wrong way out of forgetfulness must repeat it, since he has omitted a condition of the prayer.
Shaykh Ibn Uthaymeen, in a separate fatwa, gives the reasoning: someone in a place where he could have asked is not in a position of ijtihad (reasoned judgment) at all, so his prayer is simply incorrect and he prays it again — even if a long time has passed.
How much error counts
Not every deviation invalidates the prayer. A slight turn to the right or left does not matter. The Prophet ﷺ said to the people of Madinah:
"What is between the east and the west is qibla"— Sunan al-Tirmidhi, from Abu Hurayrah
Shaykh Ibn Uthaymeen explains this covers a small deviation: if you are north of the Ka'bah, then east to west is your qibla; if you are south, the same; if east or west of it, then north to south. A minor tilt within that range does not harm the prayer.
What does invalidate it is a clear deviation — turning from one direction to another, so that the qibla is effectively to your right or your left rather than ahead of you. That is the line the scholars draw.
If you realise during the prayer
If it becomes clear to you while you are still praying that you are facing the wrong way, you turn toward the qibla and continue — you do not start over. Ibn Qudamah, in al-Mughni, states that whoever discovers the error while praying turns to the direction of the Ka'bah and builds on what he has already prayed, because what he prayed was valid. This is what the Companions did at Quba when news reached them mid-prayer that the qibla had been changed: they turned as they were.
If you are praying in congregation and the imam alone realises, he turns and the congregation follows him. If only some of them realise, those who know turn, and the rest follow their imam.
If you were following someone else
A person who is not himself judging the direction but following someone he trusts — an imam, a knowledgeable local — follows that person's turning. Ibn Qudamah notes that if the one he follows turns, he turns with him; he does not turn on his own uncertainty, because he began on a certain basis and does not abandon it for doubt.
When you cannot face the qibla at all
There are situations where facing the qibla is lifted entirely, and no repetition is due:
- You are unable to turn — illness, being restrained, or trapped in a position you cannot leave. You pray as you are.
- You fear harm — an enemy, a flood, a predatory animal. You pray in whatever direction you can.
- You are travelling and praying a voluntary prayer — you may pray facing the direction of travel, though it is recommended to face the qibla for the opening takbir if you can.
These are concessions, not failures, and the prayer stands.
Key takeaways
- Effort, not accuracy, is what you are accountable for: if you genuinely tried to find the qibla and got it wrong, your prayer is valid and you do not repeat it.
- Negligence makes the prayer invalid: if you could have asked or checked and did not, you must repeat the prayers you offered facing the wrong way.
- A slight deviation is forgiven: a small turn to the right or left does not harm the prayer; a clear turn from one direction to another does.
- Realising mid-prayer, you turn and continue: you do not restart the prayer, and the congregation follows the imam.
- If you were unable to face the qibla at all — illness, fear, or voluntary prayer while travelling — the obligation is lifted and no repetition is due.
And Allah knows best.
Sources3
This is a guide to what the scholars have said, not a fatwa. For your own situation, ask a qualified scholar who can hear the details.