Allah Almighty saw the sincere repentance of Jonah and heard his invocation in the whale's stomach. Allah commanded the whale to surface and eject Jonah onto an island. The whale obeyed and swam to the farthest side of the ocean. Allah commanded it to rise towards the warm, refreshing sun and the pleasant earth.
The whale ejected Jonah onto a remote island. His body was inflamed because of the acids inside the whale's stomach. He was ill, and when the sun rose, its rays burned his inflamed body so that he was on the verge of screaming for the pain. However, he endured the pain and continued to repeat his invocation to Allah.
Almighty Allah caused a vine to grow to considerable length over him for protection. Then Allah Exalted caused Jonah to recover and forgave him. Allah told Jonah that if it had not been for his praying to Him, he would have stayed in the whale's stomach till the Day of Judgment.