It was narrated from Aishah that the Prophet said:
"May Allah curse people who take the graves of their prophets as Masjids."