There was no immediate claim of responsibility as security forces began a search for the attackers.
Turkey, Iraq's central government in Baghdad and Kurdish authorities in Erbil condemned the attack, which took place weeks after Turkey launched a new military offensive against Kurdish separatist militants based in northern Iraq.
Ankara's main enemy in Iraq is the PKK group, which has based fighters in the mountainous border region, north of Erbil, during its decades-long insurgency in southeastern Turkey.
Turkey and the ruling Kurdish party in Erbil, the KDP, have blamed the PKK for other Turkey-related incidents in northern Iraq including the storming of a Turkish military camp earlier this year.
Turkey's foreign ministry said one of those killed on Wednesday was a diplomat working at its consulate to semi-autonomous Iraqi Kurdistan.
A statement from the Kurdish internal security service said two people were killed - the diplomat and another civilian - and one other person was wounded.
The Kurdish officials and Iraqi state television earlier said three people were killed and that they were all Turkish diplomats and included the deputy consul.
One witness told Reuters that an attacker entered the restaurant and started shooting before he fled in a car that was waiting for him outside.
It was a rare major security incident in Erbil, where a new president and prime minister, part of a clan that has controlled the KDP for decades, recently took office. The KDP has said it will continue to cooperate closely with Ankara against the PKK.
"Nobody invited them (the PKK) here," Prime Minister Masrour Barzani said in an interview with Reuters this month.
"We disapprove of their activities and ... of their presence here. We understand the concerns of the neighbouring countries about security issues," he said, adding that Erbil would look to strengthen relations with Turkey.
Ankara's forces have regularly carried out air raids against PKK targets in northern Iraq and in May dropped commandos on mountain ridges in a new operation against the militants.
Turkey has called for Baghdad to take a more active role in helping it eliminate the PKK, and has waged offensives in recent years against PKK allies in northern Syria.
LEAVE A COMMENT Your email address will not be published. Required fields are marked*
Lebanon security forces face off against protesters near parliament building
Tunisia condemns 8 to death for presidential guard attack
Iran to send black boxes of downed Ukrainian plane to Ukraine
Europe will face terror threat if Tripoli govt falls: Erdogan
Khamenei expresses support for Guards
Foreign powers to push Libyan rivals for truce in Berlin
Canada says black boxes from Iran crash should be sent to France
Dozens killed as Damascus presses Idlib offensive
Regime air raids kill 18 civilians in Idlib city