A gunman has killed a senior Turkish diplomat and a civilian in Erbil, the capital of Iraq’s northern Kurdistan region, in a daytime attack inside a restaurant.

There was no immediate claim of responsibility, but Turkey’s president, Recep Tayyip Erdoğan, vowed to find whoever was behind the “treacherous” attack. The dead man was identified by Iraqi media as the deputy consul for the region.

He had just arrived at the restaurant with a group of consulate staff when the gunman opened fire, the owner of the Huqqabaz restaurant told Andalou news agency. One other person was injured in the attack.

The attacker was wearing civilian clothes and carried two guns. An accomplice waited outside to drive him away from the Huqqabaz, which sits in an upmarket area on the airport road.

The attack shocked the normally quiet city, which escaped most of the violence that followed the 2003 US invasion of Iraq, and the rise of Isis in surrounding areas.

Iraqi authorities and the ruling Kurdish party in Erbil, the KDP, both condemned the killings.

The attack came shortly after Turkey announced a new military operation against Kurdish militants in northern Iraq. Airstrikes there on Wednesday killed at least seven members of the Kurdistan Workers party (PKK).

Ankara has labelled the group – which has been fighting an insurgency in southern Turkey for three decades – a terrorist organisation.

Both Turkey and the KDP have blamed the PKK for other attacks on Turkish interests in the area, including the storming of a Turkish military camp earlier this year.

But asked whether the group could have played a role in the latest attack, the Turkish foreign minister, Mevlüt Çavuşoğlu, said it was not yet clear, as Iraqis at the restaurant were also targeted.

“We are continuing our contacts so that details concerning the issue of the apprehension of the assailants, and what is behind the attack, are brought to light,” Çavuşoğlu said.

Iraqi Kurdistan is gradually recovering from the aftermath of a disastrous independence referendum in 2017, that won majority support but prompted a fierce reaction from the central government.

Baghdad closed Kurdistan’s airspace and some borders, the army reclaimed the oil rich city of Kirkuk from Kurdish fighters, and funding for Kurdistan was halted.