“Indeed Allah answers the supplication of the distressed one even if he may be a disbeliever.” – Shaykh ibn ‘Uthaymeen rahimahullah
“Indeed Allah answers the supplication of the distressed one even if he may be a disbeliever.
The proof is that when they are aboard the ship (at sea) they supplicate to Allah, making the religion purely for Him. But when He delivers them safely to land they associate partners with Allah; so they are polytheists and He knew that they would return to Shirk once they were delivered. In spite of this, He responds to them due to their sense of urgency for Him and their taking refuge with Him.”
– Shaykh ibn ‘Uthaymeen (rahimahullah)