Jami` at-Tirmidhi, Book 2, Hadith 172 (Tirmidhi 320)

Ibn Abbbas narrated:

"Allah's Messenger cursed the women who visit the graves, and those who use them as Masajid and put torches on them."