An Egyptian security official says police detained a teacher in the northern coastal city of Alexandria after one of his pupils — a schoolboy — died in hospital, after allegedly being hit by the teacher.

The official says the city prosecutor ordered the detention of 23-year-old math teacher, Haitham Abdel Hamid, on Monday.

The boy reportedly collapsed and fell into a coma after the teacher kicked him in the classroom, allegedly because the boy did not complete his homework. The boy died later in hospital.

The official spoke on condition of anonymity because he was not authorized to talk to media.

Corporal punishment is common in overcrowded Egyptian schools, where teachers get meager salaries and lack sufficient training.