Turkey and Iraq have agreed to "expend all efforts" to oust a Kurdish separatist group from northern Iraq.
Turkey had wanted to complete a counter-terrorism agreement
Turkish PM Recep Tayyip Erdogan and his Iraqi counterpart, Nouri Maliki, signed a memorandum of understanding on security issues after talks in Ankara.
Ankara had warned Iraq to crack down on the Kurdistan Workers' Party (PKK) within its borders or face a possible incursion by Turkish troops.
Around 80 Turkish soldiers have died in skirmishes with the PKK this year.
The Turkish military has deployed tens of thousands of troops along its southern border in recent months and has been calling for cross-border operations to target the 4,000 PKK activists it believes are in northern Iraq.
The PKK, which has been fighting for an ethnic homeland since 1984, has been labelled a terrorist organisation by both the US and the EU.
Speaking at the end of talks in the Turkish capital, Mr Erdogan said Turkey and Iraq had agreed to do everything possible to stop the PKK.
"We have reached an agreement to expend all efforts to end the presence of the Kurdistan Workers Party or PKK in Iraq," he told a news conference.
Mr Erdogan said Turkey and Iraq had agreed to speed up work to finalise a counter-terrorism agreement.
Mr Maliki said Iraq understood Turkey's concerns about PKK attacks, but that he was unable to make any more definite commitment to removing the group from its bases.
"We found a mutual understanding with the Turkish side about the need to co-operate to confront the activities of all terrorist organisations in Iraq, including the PKK," he said.
"There was agreement to unite our joint efforts to find a solution that will end, eliminate, and cancel [the PKK's] presence on Iraqi territory through shared action by both parties."
Mr Maliki insisted the agreements signed in Ankara would be binding for the Kurdistan Regional Government in northern Iraq, which has been accused of overlooking the PKK's presence.
The BBC's David O'Byrne in Istanbul says that while the agreement is clearly not as far reaching as he would have liked, Mr Erdogan will be hopeful that it will be sufficient to placate both the Turkish military and nationalists.
They punctuated Turkey's recent election campaign with calls for retaliatory strikes against the PKK.
With Baghdad able to exert little influence on the Kurdish-controlled north of the country, Mr Erdogan will be well aware that his Iraqi counterpart is really not in a position to offer more, our correspondent says.