BAGHDAD (CNN) -- Fifteen Turkish soldiers were killed in an overnight clash with Kurdish rebels in southeastern Turkey along the country's border with Iraq, President Abdullah Gul said.
Turkish tanks on the move earlier this year in southeastern Turkey.
Two others were missing and 20 were wounded, two of them seriously, the Turkish military said.
"The terror group wants to show that it is still alive," Gul told reporters. "That's the reason for this attack."
Gul was referring to the Kurdish Workers Party, or PKK, the leading Kurdish rebel group in the region.
The Associated Press reported at least 23 rebels were killed when Turkish troops later returned fire.
Most of the casualties in the attack, which was launched from northern Iraq, were caused by heavy arms fire, the military said.
The attack comes prior to Tuesday's scheduled vote by the Turkish government that would extend the authority of the Turkish military to launch attacks on PKK positions in northern Iraq.
The attack, which began Friday and ended Saturday, occurred in Semdinli, a town in the southeastern province of Hakkari, said the state-run Anatolia news agency.
Iraqi government spokesman Ali al-Dabbagh condemned the "terrorist act," saying it "creates a serious threat to the security of the border areas and the joint security of Iraq and Turkey."
He called on the Turkish government to deal with this "criminal act wisely and with self-restraint."
"The Iraqi government expresses its support for the measures the Turkish government will take within Turkish territory to guarantee its [Turkey's] security and stability," he said.
The central Iraqi government has labeled the PKK a terrorist organization, banning its activities and shutting its offices in the country two years ago.
But the PKK continues to operate in the Qandil Mountains in northern Iraq bordering Turkey and Iran.
A PKK spokesman acknowledged the attack on a Turkish military post, but called the casualty figure given by the Turkish authorities "an exaggeration."
Afterward, Turkish Prime Minister Tayyip Erdogan canceled a planned visit to Mongolia.
The PKK has been a separatist faction fighting for self-rule in southeastern Turkey.
But the group's leader recently said he would settle for less than a Kurdish state.
In an interview held in the group's Qandil Mountain hideout, the PKK's military commander, Bahoz Erdal, told CNN that the PKK was defending Kurdish rights and attacked only military targets.
"We are ready for a political solution," Erdal said.
He said they would lay down their arms if Kurds were guaranteed equal rights within Turkey.
The Turkish government, in response to CNN's query, said last week that it did not negotiate with "terrorists."
In February, Turkish military ground forces launched a week-long offensive against the rebels in northern Iraq.
The Iraqi government opposes the PKK presence, but views Turkish military incursions as a violation of its sovereignty.
The United States labels the PKK a terrorist organization.
CNN's Jomana Karadsheh and Talia Kayali contributed to this report.