A man set off a pipe bomb strapped to himself at a location near Times Square on Monday morning, injuring the suspect and three other people, police said.

The 7:30 a.m. explosion occurred in an underground passageway under 42nd Street between 7th and 8th Avenues. New York City Mayor Bill de Blasio and the police labeled it an attempted terror attack.

(Getty)

The man, identified as Akayed Ullah, a 27-year-old Brooklyn resident, was arrested and sustained non-life-threatening injuries, the police said.

"Thank God the perpetrator did not achieve his ultimate goals," de Blasio said.

"This is New York City, we don't live in fear. But if you see something suspicious you have an obligation to come forward and tell us," Police Commissioner James P. O'Neill said.