Worshippers feared “someone with a gun” was attacking one of two mosques targeted with ball bearing catapults.
Masjid Qamarul Islam, Birmingham, came under attack at 22:00 BST on Wednesday and Al-Hijrah mosque half-a-mile away was targeted 20 minutes later.
It comes days after a man was arrested on suspicion of terror offences in London but police said the motive for the attacks on the mosques was unclear.
Imam Usman Hussain said people were “frightened” as windows were smashed.
West Midlands Police said the attacks were being treated as hate crimes and were thought to be linked.
Firearms officers were called to Masjid Qamarul Islam in Fosbrooke Road, Small Heath, and the Al-Hijrah mosque in Hob Moor Road as a precaution.
The ball bearings recovered were thought to be from a heavy duty catapult, police said.
Police said they were continuing to patrol the area to reassure worshippers and local residents.
“Worshippers thought they were under attack by someone with a gun,” Mr Hussain from Masjid Qamarul Islam said.
“We heard a loud bang, people were very frightened, there was a sense of panic, but we don’t know what the motive was.”
Supt Tom Joyce said: “The motives remain unclear and we are doing our utmost to discover who is responsible for these totally unacceptable incidents.”
Anthea McIntyre, co-founder of the campaign group West Midlands Together, said the attacks were an act of “unreasoning hatred”.
“Happily the communities targeted showed admirable restraint and dignity, but that does not take away from the nastiness of the hate crime committed.”
The attacks come after Nassar Mahmood, a trustee of Birmingham Central Mosque, said Muslims were facing “unprecedented” levels of Islamophobia.
He made the statement after a 29-year-old man was arrested on suspicion of terror offences and attempted murder when a car crashed outside the Houses of Parliament on Tuesday.
Mr Mahmood urged the media not to speculate on any motive and added: “We are shocked and saddened by this just the same as everybody else.”