Why is «مَسَاجِدَ» genitive in «مَرَرْتُ بِمَسَاجِدَ»?

Noun Case Classes: Type 3 — Diptote (Ghayr Munṣarif)