Authorities are investigating the stabbings of nine people at a Minnesota mall as a potential act of terrorism - a finding that would realise long-held fears of an attack in the immigrant-rich state that has struggled to stop the recruiting of its young men by groups including the Islamic State.

A young Somali man dressed as a private security guard entered the Crossroads Center mall over the weekend wielding what appeared to be a kitchen knife. The city's police chief said the man reportedly made at least one reference to Allah and asked a victim if he or she was Muslim before attacking. The rampage ended when the man was shot dead by an off-duty police officer. None of the injured suffered life-threatening wounds.

The motive is still unclear, but FBI Special Agent-in-Charge Rick Thornton said Sunday the stabbings were being investigated as a “potential act of terrorism,” and the Islamic State claimed responsibility. Authorities were digging into the attacker's background and possible motives, looking at social media accounts, his electronic devices and talking to his associates, Thornton said.

It doesn't appear anyone else was involved in the attack, which began at around 8pm and was over within minutes, Police Chief Blair Anderson said.

Leaders of the Somali community in central Minnesota united Sunday to condemn the stabbings. They said the suspect - identified by his father as 22-year-old Dahir A. Adan - does not represent them, and they expressed fear about a backlash.

Minnesota has the nation's largest Somali community, with census numbers placing the population at about 40,000 but community activists saying it's even higher.

The community has been a target for terror recruiters in recent years. More than 20 young men have left the state since 2007 to join al-Shabab in Somalia, and roughly a dozen people have left in recent years to join militants in Syria. In addition, nine Minnesota men face sentencing on terror charges for plotting to join the Islamic State group.

The possibility of an attack on US soil has been a major concern for law enforcement. Stopping the recruiting has been a high priority, with law enforcement investing countless hours in community outreach and the state participating in a federal project designed to combat radical messages. If Saturday's stabbings are ultimately deemed a terrorist act, it would be the first carried out by a Somali on US soil, said Karen Greenburg, director of the Center on National Security at Fordham University School of Law.

St. Cloud Mayor David Kleis said an attack like Saturday's is the type of worry that keeps him “up at night.”

An Islamic State-run news agency, Rasd, claimed Sunday that the attacker was a “soldier of the Islamic State” who had heeded the group's calls for attacks in countries that are part of a US-led anti-IS coalition.

It was not immediately clear if the extremist group had planned the attack or even knew about it beforehand. IS has encouraged so-called “lone wolf” attacks. It has also claimed past attacks that are not believed to have been planned by its central leadership.

Authorities didn't identify the attacker. The identification of Adan came from his father, Ahmed Adan, who spoke to the Star Tribune of Minneapolis through an interpreter. Ahmed Adan said his son was born in Kenya but was Somali and had lived in the U.S. for 15 years. Local activists also identified Dahir Adan as Somali.

Ahmed Adan said police told him around 9 p.m. Saturday that his son had died at the mall, and that police had searched the family's apartment, seizing photos and other materials. He said police said nothing to him about the mall attack, and that he had “no suspicion” that his son had been involved in terrorist activity, the newspaper reported.

Police had had three previous encounters with the attacker, mostly for minor traffic violations, Anderson said.

A spokesman for St. Cloud State University confirmed that Adan was a student there, but had not been enrolled since the spring semester. Spokesman Adam Hammer said Adan's intended major was information systems, which is a computer-related field.

Anderson said the man began attacking people right after entering the mall, stabbing people in several spots inside. The victims included seven men, one woman and a 15-year-old girl.

Five minutes after authorities received the first 911 call, Jason Falconer, a part-time officer in the city of Avon, shot and killed the attacker. Anderson said Falconer fired as the attacker was lunging at him with the knife, and continued to engage him as the attacker got up three times.

“He clearly prevented additional injuries and potential loss of life,” Anderson said. “Officer Falconer was there at the right time and the right place,” he said.

People stand near the entrance on the north side of Crossroads Center mall between Macy's and Target as officials investigate a reported multiple stabbing incident, Saturday, 17 September, 2016, in St Cloud, Minnesota (AP)

The attack in St. Cloud, a city of about 65,000 people, began shortly after an explosion in a crowded New York City neighborhood injured 29 people. A suspicious device was found a few blocks away and safely removed. Hours before that, a pipe bomb exploded in Seaside Park, New Jersey, shortly before thousands of runners were due to participate in a charity 5K race. There was no immediate indication that the incidents were linked.

The mall was expected to reopen Monday after being closed Sunday.

Photos and video of the mall taken hours after the incident showed groups of shoppers waiting to be released, including some huddled together near a food court entrance.

Sydney Weires, 18, and two of her friends were shopping when the stabbings happened. Weires said she saw a man who appeared to be a security guard sprinting down the hallway, and then two men stumbled out.

“One was covered in blood down his face,” she said, and the other man had blood on his back. “They were screaming, 'Get out of the mall. Someone has a knife,”' Weires said.

Falconer, who was shopping when he confronted the attacker, is the former police chief in Albany, which is about 15 miles northwest of St. Cloud, and the president and owner of a firing range and firearms training facility, according to his LinkedIn profile. His profile says he focuses on firearms and permit-to-carry training, and also teaches “decision shooting” to law enforcement students at St. Cloud State University.

No one answered the door late Sunday at a home address listed for Falconer, and a voicemail box for a telephone listing was full and not accepting new messages. In a brief interview with the Star Tribune, Falconer said he had “been trying to stay away from it all, for the time being.”

He told the newspaper he wasn't hurt and declined to talk further, citing the ongoing investigation for not saying more.