A man has been jailed for life with a minimum term of 20 years after carrying out two knife attacks including stabbing a schoolboy in the head near a mosque.

Dominic Palmer stabbed the 15-year-old multiple times, police said, after he had been dropped off outside the Hussaina Mosque in Small Heath, Birmingham, by his father at 1am on 30 September last year.

Palmer, 29, of Birmingham, fled the scene as the boy’s father and members of the congregation ran to help him. The boy was taken to Birmingham Children’s hospital where he was treated for injuries to the head and neck before being put in an induced coma.

CCTV at the block of flats where the defendant lived showed him returning with bloodstained hands before he went to attack a second victim, stabbing a 59-year-old woman in the face a few hours later as she was walking to work in Cyril Road.

CCTV still showing Dominic Palmer returning to his flat with bloodstained hands after stabbing a schoolboy. Photograph: West Midlands police/PA

The woman suffered knife wounds to her nose, jaw and head. Officers said she may not have survived if a member of the public had not come to her aid.

Palmer, who was unemployed, denied two counts of attempted murder but was convicted by a jury and he received a 20-year minimum prison term on Friday.

DI Richard Marsh, who led the inquiry, said: “These were savage attacks; without intervention of members of the public and medical assistance both incidents could have resulted in fatal consequences.

“Palmer has never offered any explanation for his actions. The awful attack on the 15-year-old boy happened outside a mosque and there were suspicions initially it was racially motivated, but that was later discounted and it appears his victims were simply in the wrong place at the wrong time.

“And although Palmer has a history of mental illness the judge concluded that did not play a part in these attacks.

“We quickly arrested Palmer and seized CCTV showing his movements immediately before and after both stabbings. His bloodstained jacket was found discarded on a grass bank near his flat and bloodstained clothing and a knife were recovered from within his premises.

“His victims are still dealing with the physical and psychological effects of these attacks and I wish them well with their ongoing recoveries.

“I’d also like to thank them for the courage and resilience they’ve demonstrated throughout the investigation and subsequent court trial, and I hope the fact Palmer has been taken out of society for a long time will offer them some comfort.”