A gunman opened fire inside a Turkish-owned restaurant in the northern Iraqi city of Irbil on Wednesday, killing at least one Turkish diplomat stationed in Ankara's consulate, Turkey's state-run news agency and Iraqi media said.

The rare shooting in broad daylight jolted the normally quiet city and sent security forces into the streets in an effort to catch the perpetrator, who apparently got away. Turkish President Recep Tayyip Erdogan condemned the "hateful" attack targeting the Turkish consulate employees and said Turkey was pressing Iraqi and the local authorities for the assailants to be apprehended quickly.

Anadolu Agency, quoting the restaurant's owner, reported that an attacker in civilian clothes and carrying two weapons opened fire at a group of consulate workers shortly after they entered the restaurant and said a Turkish diplomat died at the site. The Turkish Foreign Ministry said an official of the Turkish consulate in Irbil was "martyred" as a result of an armed attack.

This image posted by RUDAW Facebook TV, an Irbil-based Kurdish broadcaster, shows security forces at the scene of a shooting outside a restaurant in Irbil, Iraq, Wednesday, July 17, 2019. Turkey's state-run news agency says a Turkish diplomat working at Ankara's consulate in the northern Iraqi city of Irbil was killed during a shooting attack inside the restaurant there. (RUDAW Facebook TV via AP)

This image posted by RUDAW Facebook TV, an Irbil-based Kurdish broadcaster, shows security forces at the scene of a shooting outside a restaurant in Irbil, Iraq, Wednesday, July 17, 2019. Turkey's state-run news agency says a Turkish diplomat working at Ankara's consulate in the northern Iraqi city of Irbil was killed during a shooting attack inside the restaurant there. (RUDAW Facebook TV via AP)

The state-run Iraqi news agency identified him as the deputy general consul and said several of his entourage were also killed in the shooting.

Kurdish security forces later said a Turkish diplomat and a civilian were killed and another civilian wounded in the attack.

"We are continuing our efforts with the Iraqi authorities and local authorities to quickly find the perpetrators of the attack," the Turkish Foreign Ministry said. Ibrahim Kalin, spokesman for Turkish President Recep Tayyip Erdogan, said on Twitter that efforts were underway to catch the assailants.

"The necessary response will be given to those who carried out this treacherous attack," he said.

There was no immediate claim of responsibility for the shooting.

Such attacks are rare in Irbil. Iraq's self-governing Kurdish region is politically allied with the Turkish government, but militants of the Kurdistan Workers' Party (PKK), who have fought a decades-long insurgency against Ankara, operate in parts of the territory. Ankara labels the group a terrorist organization.

In recent months, the Turkish military has intensified air and ground operations against them across the border.

The shooting occurred at HuQQabaz, a popular restaurant in an upscale and high security area only a five-minute drive from the Turkish consulate on the airport road.

Security forces sealed off the area, keeping journalists on the other side of the road. The front window facade of the restaurant was shattered and police were standing outside.

The Kurdish Rudaw news agency published a photo of a car parked outside the restaurant with blood stains on it. It said security and emergency officials were responding to the incident and that the scene was on lockdown.

The attack came days after Turkey's Defense Ministry announced it launched a new military operation against Kurdish militants in northern Iraq. In a statement issued Saturday, the ministry announced the start of "Operation Claw-2" aiming to destroy caves and shelters used by members of the PKK in the Hakurk region. It said the operation began late Friday with commandos, air strikes and artillery.

On Wednesday, Turkey launched airstrikes that killed at least seven members of the PKK.

The PKK has been waging an insurgency for more than three decades, and its fighters have bases in northern Iraq, near the border with Iran. Turkey has regularly bombed the mountainous area where the PKK are based and in March targeted a meeting of senior PKK leadership there, wounding a senior commander and killing three others.

Ankara accuses the PKK of launching assaults into Turkey from the Kurdistan region and has kept bases in Iraq and targeted the militants stronghold for decades, an agreement it had reached with the previous Iraqi regime under Saddam Hussein where the two countries agreed to use each other's territories to safeguard their borders.