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*
Hezbollah says explosive-laden drone damaged its media centre
Security forces arrest Palestinians in West Bank
Yemen govt takes control of city after separatist clashes
Tunisia's Karoui still presidential candidate despite arrest - electoral commission
Car blast, air strikes hit Syria's Idlib city
Flights suspended at Libya airport after rocket fire
Shots fired at bus near Jordan's ancient Petra, no injuries
Bomb attack kills teen, injures two in West Bank
Syrian army takes towns in northwest that rebels held for years