Nizwa was once a major centre for Islamic scholarship, and two aged mosques, among the oldest in the world, have survived since the early 7th century. Nestled up against the souq and the fort, the mosque (closed to non-Muslims) forms part of a fine ensemble of buildings in the middle of the town.
If you're wondering why no one builds on the empty ground in front of the mosque, it's because (however unlikely it may seem in this hot and arid location) this is an active wadi that flows with mountain water several times in a year.