An Afghan official says a deputy provincial governor has been shot dead in southern Kandahar province while he was sitting in class at a university.

Thirty-two-year-old Abdul Qadeem Patyall died of his injuries after a gunman opened fire on him through the window of a classroom at Kandahar University, Samim Khpolwak, spokesman for the provincial governor, said Monday. The attack took place late Sunday.

Patyall, who was studying to become a teacher, was seriously wounded and died later in hospital, said Khpolwak.

President Ashraf Ghani has sent condolences to Patyall's family and described his killing as a terrorist attack, the presidential palace said. A government delegation will investigate the incident.

No group has claimed responsibility for the attack. Taliban insurgents have intensified anti-government activity in recent months.