The project became the subject of a heated debate, with opponents questioning its construction and permits and supporters defending their right to a place of worship.