Sunan an-Nasa'i, Book 21, Hadith 226 (Nasa'i 2048)

It was narrated that Ibn Abbas said:

"The Messenger of Allah cursed women who visit graves, and those who take them as Masjid and put lamps on them."