The Mughal-era mosque has been at the centre of a major row after a petition claimed that it was the site of an ancient Hindu temple.