QUETTA, Pakistan (Reuters) - Islamist gunmen on Thursday killed a senior police official and three other policemen guarding him in the Pakistani city of Quetta, police said, in an attack claimed by both the Pakistani Taliban and Islamic State.

Relatives react outside the hospital after policemen were shot dead in Quetta, Pakistan July 13, 2017. REUTERS/Naseer Ahmed

Superintendent of Police Mubarak Shah, 56, was killed en route to his office when four gunmen riding on motorcycles attacked his vehicle, said city police officer Muhammad Sultan.

“The head and upper parts of all the four victims were targeted,” said Sultan, adding that one policeman was critically wounded.

A faction of the Pakistani Taliban, known as Jamaat-ul-Ahrar, carried out the attack, according to the faction’s spokesman, Asad Mansur.

Islamic State (IS) also claimed the attack on it Amaq News Agency website. Jamaat ur Ahrar and IS have in the past jointly claimed responsibility for attacks in Pakistan.

Prime Minister Nawaz Sharif condemned the attack, his office said.

It was second such attack in a week targeting senior police officers in the volatile Baluchistan province, which borders Afghanistan and Iran. Quetta is the provincial capital.

A suicide bomber on Monday killed a district police chief and his guard in the town of Chaman on the Afghan border. The Pakistani Taliban claimed that bombing in text messages and emails to media.

Violence in Baluchistan has raised concern about security for projects in the $57-billion China Pakistan Economic Corridor, a planned transport and energy link from western China to Pakistan’s southern deep-water port of Gwadar.

Resource-rich Baluchistan has long been plagued by insurgencies by separatists. Islamist groups such as the Taliban and Islamic State also carry out attacks in the region.

Islamist militants have killed thousands of people in Pakistan over the last decade or more, in their bid to impose hardline rule.