Eyewitnesses reported chaotic scenes as the incident unfolded just after midnight, when worshipers had finished evening Ramadan prayers.
A 48-year-old man was wrestled to the ground by members of the public
and then arrested at the scene on suspicion of attempted murder, London's Metropolitan police said.
"This is being treated as a terrorist attack and the Counter-Terrorism Command is investigating," said Neil Basu, senior national coordinator for terrorism at the Met. All the victims were Muslim, he said.