A man has been arrested on suspicion of terrorism offences after several people were stabbed in Manchester’s Arndale shopping centre, sending bystanders running for their lives.

Three people were stabbed and taken to hospital after the attack on Friday morning, police said. Two other people were assessed, one was treated at the scene and the other later went to hospital with a superficial wound.

The suspect, 40, was seen shouting and behaving erratically, bystanders said. He was later arrested on suspicion of terrorism offences and was being investigated for the preparation and instigation of an act of terrorism.

Police said he had been assessed by specialist doctors and compulsorily detained under the Mental Health Act. They said they did not believe there was any wider threat to the community and it was thought he acted alone.

Greater Manchester police assistant chief constable Russ Jackson said a man had entered the shopping centre at 11am armed with a large knife. “He entered Exchange Court and lunged at and attacked people with the knife. Two community support officers were in Exchange Court and attempted to confront the attacker.

“He chased them with the knife as they called for assistance. He attacked people around him and we understood that five people were injured, although thankfully none [of the injuries] are life-threatening.”

Jackson said the man was apprehended within five minutes and was initially arrested for serious assault and taken into custody. He was later rearrested under terrorism offences.

“We don’t know the motivation for the attack. It was brutal and extremely frightening for everyone who witnessed it. We don’t believe anyone else was involved, but we are keeping it under review,” he added.

The investigation into the attack was focusing on whether the suspect was incited by Islamist propaganda and how big a part mental health issues may have the played.

The man arrested was not believed to have previously known to counter-terrorism authorities. He was not on a list of 3,000 current subjects of interest run by MI5 or their list of 20,000 former subjects of interest.

Sources stressed the motives in the case seemed initially harder to discern than normal and that the investigation was at a very early stage in understanding what drove the attack.

Police have asked the public for any images or footage that may have been taken at the scene and said anyone who may have information that could assist the investigation should call 0161 856 0394.

Witnesses described people screaming and “running for their lives” after the man was seen shouting and using racial epithets near the Superdry store in the shopping centre.

Janet Loudon, 21, and a friend, who wanted to remain anonymous, had just met up when they heard a disturbance outside the Arndale. Loudon said she came out of work at 10.30am and encountered a black man shouting racial slurs including the N-word and being hostile towards an Arndale worker, who was also black.

“It wasn’t clear what the man was saying but he was swearing and telling the public, ‘I’m going to fuck you up,’ repeatedly and he got more and more agitated. He was pointing at the police and Arndale workers,” she said, adding that he claimed he was being targeted because of his race and referred to himself using the N-word.

“Everyone was panicking and frantic. We saw a victim slouched between an ATM which was a horrific sight and she was taken away to be helped.”

A 19-year-old woman, another woman for whom no age was given and a man in his 50s were taken to hospital with stab wounds.

A fourth victim – a woman in her 40s who was not stabbed – did not need to go to hospital following assessment by paramedics. Another woman has since gone to hospital with a superficial wound.

Video footage and photographs showed armed police officers deployed around the Exchange Square side of the shopping centre. One clip showed officers using a Taser and holding a man to the ground before arresting him.

John Greenhalgh, 30, who captured the footage, was travelling on a tram when it stopped suddenly. “You could tell it was something quite serious,” he said. “There were a lot of armed police. They were there very quickly.

“The tram was evacuated and we were put in the back of a van. We weren’t told what was happening. There was a guy sitting on the floor screaming.”

In other video and pictures posted on Twitter, a large number of emergency service vehicles were seen arriving at the centre. Footage showed people being taken away on stretchers, and members of the public were asked to stay away from the centre.

Play Video 0:26 Manchester stabbings: man held on ground by police at Arndale centre – video

Armed police officers wearing face coverings were stationed outside the centre as a long queue of ambulances arrived and a police helicopter hovered overhead. Plainclothes detectives arrived at the scene while uniformed officers told people the Arndale would be closed for some time.

Bernadette Westhall, 55, said she saw people “running for their lives” and screaming as the attack unfolded. She was in the toilets on the ground floor near a Starbucks cafe when she heard a commotion. “I was coming out of there and everybody was just screaming and running for their lives. I ran straight into a shop and stayed in there until the coast was clear. It was a lady that he attacked.”

Shazia Asif, 40, a carer from Oldham, said: “I was upstairs shopping in the Next. I looked down to outside the Starbucks and saw a woman had been stabbed. There was a lot of blood.

“Somebody had a scarf around her arm – I think she had been stabbed in the arm. They then said, ‘Get out.’ I was just shocked. I didn’t see anyone running away.”

Facebook Twitter Pinterest Emergency services at the scene Photograph: Christopher Thomond/The Guardian

One man, who did not wish to be named, was working in a fire and security services office across the road from the Arndale and spotted police detaining a man with a knife just before the alarm was raised about the stabbings.

He said: “They pinned a guy against a wall. Then I saw a policewoman with them holding a foot-long knife in a tube – I didn’t see if it had blood on it. It was about 12 inches long and looked like a machete.”

On Friday afternoon a cordon remained around the shopping centre as forensic teams searched the area. Shops in the centre remained closed as some workers were allowed back in to collect their personal belongings.