I went through the exact same thing , and you will be surprised that many Christians have got through it to , and because it disturbed my mind sooooo much , I could not even sleep , but God is good and faithful , He brought me closer to Him in His Word , and one Scripture that sticks out for me right now as I type is this , Philippians 4:7 And the peace of God, which transcends all understanding, will guard your hearts and your minds in Christ Jesus.
This gave me so much comfort , and the fact that I found it so disturbing of what my mind was capable off , I was led to know that be bothered by the thoughts were a sure sign it was alien to me...
What does not help is I suffer with a kind of OCD thinking , so this sent me to despair , but God is the lifter of our souls...xox...
So glad you came through it , praise God...