BRUSSELS — A man carrying a knife attacked two police officers in the Molenbeek neighborhood of Brussels on Wednesday, but the officers were wearing bulletproof vests and suffered only bruises, prosecutors said.

Brussels prosecutor’s office spokeswoman Ine Van Wymersch said the motives of the suspect arrested in the attack, a 24-year-old Moroccan known for having committing several thefts and who was residing in Belgium illegally, were not immediately known.

Van Wymersch said the officers approached the man around 2:45 p.m. after a woman walking with her children in a park told them she’d spotted a man holding a knife.

She said the man allegedly then attacked the officers without saying a word. The knife struck one officer seven times and the other once, but protective vests prevented the blade from penetrating their skin.

“There is no indication at this time that it’s terrorism-related,” Van Wymersch said. She said the suspect had received several orders to leave Belgium, but had no known connection to extremist activities or views.

That the prosecutor’s office in Brussels was investigating the incident rather than its federal equivalent also was a sign that Belgian authorities had no evidence the knifing was linked to religious or political extremism.

On Aug. 6, a machete-wielding man shouting “Allahu akbar!” — Arabic for “God is great!” — seriously wounded two policewomen outside the main police station in the southern Belgian city of Charleroi. The assailant, a 33-year-old Algerian who was in Belgium illegally, was shot dead by police, and subsequently identified by the Islamic State group as one of its “soldiers.”

Molenbeek, a scruffy, multiethnic district on the west side of Belgium’s capital, was home to some of the participants in the attacks claimed by the Islamic State group that killed a total of 162 victims in Paris and Brussels over the last year.