Offering Salah (Prayer) in a Masjid

Q: Is it permissible to offer Salah (prayer) at a Masjid (mosque) where there is a grave? The grave is in the opposite side of the Qiblah (Ka`bah-direction faced in Prayer).

A: If the dead person was buried in the Masjid, then the grave should be entombed and the dead person should be moved to a public grave. But if the Masjid was built on the grave, then the Masjid should be demolished.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.