A man is facing a slew of assault charges after he allegedly attacked a police officer while trying to flee the provincial courthouse in Halifax.

Halifax Regional Police were called to provincial court on Spring Garden Road before 11 a.m. Thursday.

Police say the man had just been sentenced to a jail term before he allegedly assaulted the officer while trying to flee the courthouse.

The man was arrested for escaping lawful custody after a brief struggle with the responding officers and sheriffs.

The police officer, who has been a member of the Halifax Regional Police for three years, was taken to hospital with non-life-threatening injuries.

Police say the officer was attending a scheduled court appearance on an unrelated matter at the time of the incident.

Mahmoud Ahmed Altawil is facing charges of aggravated assault of a peace officer, assaulting a peace officer causing bodily harm, aggravated assault, three counts of assaulting a peace officer, escaping lawful custody, and resisting arrest.

The 24-year-old man is due to appear in Halifax provincial court on Tuesday.