Saad 34

وَلَقَدْ فَتَنَّا سُلَيْمَٰنَ وَأَلْقَيْنَا عَلَىٰ كُرْسِيِّهِۦ جَسَدًا ثُمَّ أَنَابَ ﴿٣٤﴾

Walaqad fatanna sulaymana waalqayna AAala kursiyyihi jasadan thumma anaba

And, indeed We did try Sulaiman (Solomon) and We placed on his throne Jasadan (a devil, so he lost his kingdom for a while) but he did return (to his throne and kingdom by the Grace of Allah and he did return) to Allah with obedience and in repentance. The Noble Quran