A man wielding a knife attacked at least four people in the US state of Massachusetts on Tuesday before being shot by off-duty security personnel, authorities have said.

Massachusetts State Police and municipal officers from the town of Taunton, about 40 miles (64 kilometers) south of Boston, later confirmed that the suspect had died of his injuries.

The man first attacked two people at a Taunton home and then drove his car through the glass entrance of a Macy's department store at the nearby Silver City Galleria mall at around 7 p.m. local time. The suspect immediately stabbed two bystanders in front of the store, police told the press.

Late on Tuesday evening, Massachusetts police wrote on Twitter that two of the victims had also died.

Witnesses told local television that they saw shoppers running out of the mall and heard gunfire.

Authorities said a motive for the attack could not immediately be determined, but that "there is no continuing threat to the public."

"The suspect's motive remains under investigation, but at this point we are aware of no nexus to terrorism," police spokesman Dave Procopio told the Associated Press.

es/cmk (AP, Reuters)