A man in the US state of Minnesota has been killed by police after stabbing 8 people in a shopping center, an attack that was later claimed by the ISIS (Daesh / ISIL) terrorist group.

The attack took place on Saturday night, when the knife-wielding attacker, who was dressed in a private security uniform, went on a rampage inside a mall in St. Cloud at around 8 pm before being gunned down by an off-duty police officer.

ISIS claimed responsibility for the attack later in the day, stating that the attacker had responded to its call for carrying out attacks in countries that are involved in an international anti-terrorism effort in Syria and Iraq.

All but one of the injured sustained non-lethal injuries and were expected to be released from the hospital soon.

St. Cloud police chief William Blair Anderson said it was not clear if the attack was linked to terrorism as police were looking for the suspect’s possible motives.

The off-duty officer who shot the assailant said the man asked at least one of the victims if they were Muslim before stabbing them.

While the attacker’s identity was not released to the media, police said they had three previous encounters with him, most of which were minor traffic violations and none led to an arrest.

The mall was put on a lockdown following the attack and would be closed until further notice. Authorities said those remaining inside the mall were expected to be released early Sunday.

The stabbings took place in various locations across the mall, including corridors, businesses and common areas. Witnesses also reported hearing gunshots, but it was not clear if what they heard was related to the same incident.

"The entire mall is an active crime scene," Anderson noted, adding that St. Cloud "won't be the same" after the stabbing spree.

St. Cloud is a small town located about 65 miles northwest of Minneapolis, and has a population of about 67,000 people.

The attack followed two suspicious explosions that ripped through New York and New Jersey earlier in the day.

The stronger explosion happened in the Chelsea neighborhood of New York City, injuring at least 29 people.

The New Jersey explosion went off in a garbage can on the route of a Marine Corps charity run.