Building mosques on farmable lands to circumvent laws
A law was issued to ban building on farmable lands. Some residents resort to building a mosque [mosque or Qur'anic school] and there after they build houses around it to circumvent the law.
Is it prohibited to build the mosque in this way…or is it lawful?
These mosques were built to circumvent public laws that forbid building on these lands, in order to build houses around the mosque or the foundation. Allah is free from this act and from these mosques which were not built for His sake. It is Masjid Dirar (mosques built for creating problems not for worship) and must be removed from this arable land, and it is impermissible to pray in them. Allah says in His holy book:
You should rather pray in a mosque founded from its first day on consciousness of God: in this mosque there are men who desire to grow purity—God loves those who seek to purify themselves. [9:108]
The above answers the question.
Allah the Almighty knows best