It is narrated from Sayyiduna Ibn Abbas (may Allah be pleased with them both) that the Prophet (peace and blessings be upon him) said: "Snakes are the transformed form of the jinn, just as apes and swine were the transformed forms of (some of) the Children of Israel."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 11896