An explosion near Tipton mosque was designed to cause "serious harm or serious damage", police said.
Police called to investigate reports of a loud bang spotted smoke, debris and nails, prompting an evacuation of residents living near the Kanz-ul-Iman Muslim Welfare Association Central Jamia Mosque in Binfield Street.
A West Midlands Police spokesman said: "An investigation is being led by the West Midlands Counter Terrorism Unit and it is being treated as a terrorist incident."
Assistant Chief Constable Gary Cann said this afternoon that the location of the blast, coupled with the cat it concided with prayers, and the discovery of nails, led officers to believe terrorism was behind the explosion.
He added: "Someone who did this looked to cause serious harm or serious damage to property."
Mr Cann confirmed that no one had been injured, but a window of a house had been damaged.
Roads closures included Sedgley Road East at Dudley Port, Dudley Port at Tudor Court, Jays Avenue at Tudor Court/Tudor Street, Park Lane East at Slater Street, Crompton Road at Martin Road and Victoria Road at Park Street.
Officers were called to Binfield Street just after 1pm and a cordon was set up immediately.
There are no reports of any injuries, but police have evacuated the area as a precaution.
Wasin Kahn, a member of the congregation spoke of how he heard the explosion.
The 23-year-old who lives on Park Lane East in Tipton said: "I heard a loud bang, at first I didn't think anything of it.
"The police were called and they evacuated the mosque and some houses at the back. There are around 20 police cars here, we just don't know what's going on.
Police at the scene of the explosion in Tipton
A resident of nearby Crompton Road said she was alerted to the incident when she saw police cars racing past her home, she said: “I was about to go out shopping at around 2pm and saw a number of police cars flying down Victoria Road and I thought ‘what’s going on here?’ "I didn’t think much of it then I got a call from friends asking if I was safe."
Live updates from the scene
John Brown who works at The MOT Bay on Sedgley Road East said: “I heard a bang and it sounded like a gas canister going off but we’re next to a tyre place and I thought it could have been a tyre that had blown.
"As soon as I saw the police coming down here and the streets being sealed off I knew it was something serious. The police helicopter is hovering above us.”
Commercial manager Mark Watton was just yards away when he heard 'an almighty bang'.
Mr Watton, aged 49, from Bloxwich, was working on his late mother's house in Coneygre Road at the time.
"The house is the other side of the railway embankment from the mosque, probably less than 50 years away," he said.
"I was working at the house and heard this very loud bang. It was just after 1pm. I rushed outside but couldn't see anything or anyone. I popped out to get some spare parts a few moments later and when I came back, 20 minutes later, the whole area was sealed off by the police."
Tipton Councillor Ian Jones made the dash from a business meeting at The Public, in West Bromwich, to get to the scene when he heard the news.
He said many of the roads nearby were either closed off by police or blocked with traffic as jams built up on neighbouring streets.
Councillor Jones said residents have come out of their homes in "confusion" at what has happened, with few details available.
Some residents who live near the mosque have been evacuated to Coneygre Community Centre, off Sedgley Road West.
Councillor Jones said: “This has always been a very strong community where there is a lot of different people living together.
“To have something like this happen is something of a surprise. People just need to stay vigilant at the moment.
“There are a lot of people who have come out their houses to see what is going on but we don’t know much at the moment.
“We just come down here as quick as we could and didn’t find the traffic too bad but it is building up on the streets nearby now.”
Anyone who saw anything suspicious in the area should call police on 101 or the Crimestoppers on 0800 555 111.
Do you live in the area? Did you hear the explosion? Share your story below.