We prayed towards a Direction other than the Qiblah, exercising Our Judgement
Question :
When we arrived in America, we prayed according to the compass, and that was not towards the Qiblah. After we became acquainted with some of our Muslim brothers there, they informed us that we had not been praying towards the Qiblah and they informed us of the right direction. My question is: Was the prayer which we performed before we knew the right direction correct, or not?
Answer:
If a believer exercised his judgement concerning the direction of the Qiblah, due to being in the desert or in a foreign land in which the direction of the Qiblah was not clear, then he prayed according to his judgement, then later it became apparent that he had prayed towards a direction other than the Qiblah, he should pray according to his final judgement, if it seems to him to be more correct than his earlier judgement. His earlier prayer is correct, because he performed it based upon his judgement and his best efforts to find the truth, and proof for this has been authentically reported from the Prophet and from his Companions, may Allah be pleased with them, when the direction of the Qiblah was changed from Jerusalem to the Noble Ka'bah. And through Allah is success attained.
Source:
Ibn Baz
Fatawa Islamiyah, Vol. 2 Pages 167-168