A Somali Muslim allegedly stabbed a policeman and three mosque worshippers after screaming: "Allah is going to punish you all."
The 32-year-old is said to have tried to kill the worshippers during an argument over whether they were praying correctly.
It is thought the man, who was not a regular at the mosque in Birmingham, became upset because the prayers were not being performed in the manner of his denomination.
Attack: The police officer and three other people were stabbed at a mosque (pictured with sign, right) in the Ward End area of Birmingham. The four are in a stable condition, according to a police spokesman
Police at the scene of the incident. A 32-year-old man was arrested on suspicion of attempted murder after the attack
One witness, who asked not to be named, said: "I heard shouting behind me as I was praying. I turned around and saw two men grappling with each other. ‘Suddenly a man pulled out a knife and stabbed the other man in the leg, near the groin.
Someone tried to intervene but the man just went for him and thrust a knife into his abdomen. It was absolutely terrifying."
Minutes later two police officers, one male and one female, arrived at the Madrasah Qasim-ul-Uloom mosque in Ward End and the man allegedly ran at them with a large combat knife.
Despite the male officer shooting him with a Taser, the man is said to have stabbed him in his chest and stomach.
The suspect, a 32-year-old Somalian man, was taken to a secure mental health facility today
Hand wound: Dr Arshad Mahmood had his hand stabbed by the knifeman in the Birmingham mosque
"The police tried to Taser the man but he didn’t fall down," the witness continued. "Instead he just lunged at the officer after pulling out his knife again and stabbed him. There was blood everywhere."
Despite his serious injuries the 31-year-old officer "heroically" overcame the man. The officer was with his family in hospital yesterday preparing for surgery.
Two of the other men were being treated for multiple stab wounds following the attack just after 11pm on Saturday. An off-duty surgeon who happened to be at prayers fought to keep them alive before paramedics arrived.
Another man, Dr Arshad Mahmood, who had his hand stabbed while trying to disarm the attacker, said: "Everyone was frightened. It was so sudden. A man started stabbing one of the guys who was just sitting right next to him.
"We went to save him. He had multiple injuries, three or four wounds. A few of us went to stop him. One of the guys was strong enough to stop him. I held his hand. One also had an injury on his thigh."
Another witness said: "He shouted 'Allah is going to punish you all.' He stabbed two people then one guy restrained him and someone called the police."
The suspect was being held yesterday in a mental health facility on suspicion of attempted murder.
The attack comes less than a month after soldier Lee Rigby was murdered in Woolwich, south London, allegedly by knifemen boasting they were avenging the death of Muslims by the military.
The male officer, who has not yet been named, was due to receive a bravery award this week for helping to save the life of a young child in a separate incident last year. Chief Superintendent Alex Murray, of West Midlands Police, praised the policeman, saying: "There was some real brave action going on inside that mosque."
He added: "There’s no connection with any other incidents that we can see at the moment – for example, Woolwich or other incidents around the country. There’s no information at this stage to suggest it was a hate crime."
Many people living locally stood out on the street to watch what was happening as police maintained a presence in the area West Midlands Police would be "looking into details" about why the Taser had no effect on the suspect.
Liam Byrne, MP for Birmingham Hodge Hill, said: ‘This was not a hate crime, this was a tragic, sad, and isolated incident. Mohammed Shafiq, of national Muslim organisation the Ramadhan Foundation, said: "We must be clear there should be no place for this sort of violence in our country."