By Ibon Villelabeitia
ANKARA (Reuters) - Turkey's Prime Minister Tayyip Erdogan on Friday promised a full investigation into airstrikes on the Iraqi border that killed 35 villagers whom the military had mistaken for Kurdish militants - an attack that has infuriated minority Kurds in Turkey and Iraq.
The strikes sparked clashes on Friday in Turkey's restive mainly Kurdish southeast and in the autonomous Kurdish northern Iraq region.
In the border village of Gulyazi, thousands of mourners attended funerals after digging deep graves along a steep cliff. The bodies, most of them young villagers who were smuggling cigarettes and diesel, were ferried on tractors or wrapped in carpets lashed to donkeys making their way along snowed tracks.
Breaking his silence over an attack Turkey's largest pro-Kurdish party has labeled a crime against humanity, Erdogan said video recordings of the air raid would be examined and forensic experts would be dispatched to the area.
"All necessary steps will be taken," Erdogan told reporters, calling the incident, one of the largest single-day civilian deaths in a decades-long conflict, unfortunate and saddening.
But Erdogan also defended the Turkish military, which has been fighting Kurdistan Workers' Party (PKK) armed militants since the group took up arms against the Turkish state in 1984.
The military had said its warplanes launched air strikes after drones spotted what looked like suspected PKK militants.
"Unfortunately, it's not possible to determine who's who from these images taken by drones. These images showed a group of 40 men near the border," Erdogan said, adding the PKK has used smugglers and mules to carry out attacks in the past.
"Our F16 jets have bombed the area as a result."
The attack undermined efforts by Erdogan to engage Kurds in talks to write a new constitution expected to address long-held Kurdish grievances. Kurds, a minority that inhabits Turkey, Iraq, Syria and Iran, have become increasingly assertive.
Some 500 protesters gathered on Friday in Arbil, the capital of Iraq's Kurdish region, to protest the killings. Some protesters threw stones and clashed briefly with Kurdish security forces, but there were no reports of casualties.
"The crime ... is a real genocide, a war crime and a crime against humanity, and breaches international laws," Kurdish activist Ali Mahmoud said. "We demand that Turkey be judged in the international courts."
The protesters carried PKK flags and pictures of its leader, Abdullah Ocalan, and shouted, "fight, fight for freedom" and "Erdogan is a terrorist."
"The Kurdish people must protest and condemn what happened," activist Lalo Rangder said. "Erdogan is a terrorist and has two faces in the sense that he asks the international community to protect Syrians and at the same time is killing Kurdish people with forbidden weapons."
Clashes also broke out across cities in Turkey's Kurdish areas and in its largest city Istanbul.
Turkish rights groups called for a U.N.-sponsored probe.
"Turkish and international non-governmental organizations should investigate the incident and the U.N. Human Rights Committee should send a committee right away," human rights groups IHD and Mazlumder said in a preliminary report into Wednesday's airstrike.
IHD and Mazlumder said most of those killed near the border village of Uludere were between the ages of 12 and 18. Turkish media have reported that 28 out of the 35 dead belonged to the same extended family and carried the same surname.
In their report, IHD and Mazlumder quoted 19-year-old Haci Encu, who survived the attack and was in hospital, as saying the smugglers were a group of about 40-50 people with mules and were attacked as they were crossing the border to Iraq.
As the group saw the planes overhead, "we started running towards Iraq, and bombs started to fall on those who were left behind on the rocky area. We were six people in my group, and three of us survived. We had civilian clothes and nobody was armed," Encu said.
"We have been doing this for a long time. Two people from the group were married, the rest were high school and secondary school students. Nobody has contacted me for testimony yet, and I haven't seen a single soldier since the incident."
The deaths threatens to ignite more violence from the PKK, which is regarded as a terrorist organization by Turkey, the European Union and the United States. The group has been fighting for an ethnic Kurdish homeland in a conflict that has claimed the lives of 40,000 people.
A PKK commander called on Kurds to rise up to what he called an organized and planned massacre.
"We call on all the people of Kurdistan and especially those of Hakkari and Sirnak to show their reaction against this massacre and to hold the perpetrators of this massacre accountable through their uprising," Bahoz Erdal said in a statement.
With most Turks favoring a hardline military response against the PKK, the incident is unlikely to hurt the popularity of Erdogan, who won a third term in office in a June vote.
(Additional reporting by Ece Toksabay and Daren Butler in Istanbul and Shamal Aqrawi in Arbil; Writing by Ibon Villelabeitia; Editing by Alessandra Rizzo)