Namuchi was a demon who was slayed By Indra deva This is how Mahabharata discribes this incident here
Vaishampayana said, "Listen to that history, O ruler of men! Hear of those occurrences as they happened! Hear how Vasava, in days of yore, broke his treaty with Namuchi! The Asura Namuchi, from fear of Vasava, had entered a ray of the Sun. Indra then made friends with Namuchi and entered into a covenant with him, saying, 'O foremost of Asuras, I shall not slay thee, O foremost of Asuras, I shall not slay thee, O friend, with anything that is wet or with anything that is dry! I shall not slay thee in the night or in the day! I swear this to thee by truth. Having made this covenant, the lord Indra one day beheld a fog. He then, O king, cut off Namuchi's head, using the foam of water (as his weapon). The severed head of Namuchi thereupon pursued Indra from behind, saying unto him from a near point these words, 'O slayer of a friend, O wretch!' Urged on incessantly by that head, Indra repaired to the Grandsire and informed him, in grief, of what had occurred.(Mahabharata book 9 shalya Parva secrion 43)
Even shatapata brahmana of the yajur Veda mentions this incident here
:11. By means of the Surâ-liquor Namuki, the Asura, carried off Indra's (source of) strength, the essence of food, the Soma-drink. He (Indra) hasted up to the Asvins and Sarasvatî, crying, 'I have sworn to Namuki, saying, "I will slay thee neither by day nor by night, neither with staff nor with bow, neither with the palm of my hand nor with the moist!" and yet has he taken these things from me: seek ye to bring me back these things!:22. They spake, 'Let us have a share therein, and we will bring them back to thee.'--'These shall be) in common to us,' he said, 'bring them back, then!' . 3)The Asvins and Sarasvatî then poured out foam of water (to serve) as a thunderbolt, saying, 'It is neither dry nor moist;' and, when the night was clearing up, and the sun had not yet risen, Indra, thinking, 'It is neither by day nor by night,' therewith struck off the head of Namuki, the Asura.
This incident is discribed in both scriptures mahabharata And shatapata brahmana.