Pakistani president Pervez Musharraf has told the Turkish parliament that terrorists have brought a bad name to Islam.
He said Pakistan and Turkey must not be held hostage by what he called their evil designs.
General Musharraf was speaking on the first day of a visit to Turkey, during which he signed an agreement on intelligence-sharing to cover terrorism and organised crime.
Turkish officials believe some of the suspects linked to the car bomb attacks in Istanbul in November received training in Pakistan.
Sixty-two people died in the blasts.
General Musharraf also warned that the gap between Islam and the West was growing although he described Turkey as a bridge between the two civilisations.
Earlier he held talks with Turkish leaders in Ankara on terrorism, trade and regional concerns.
Officials from Pakistan and Turkey are scheduled to sign three agreements, including one calling for increased cooperation in the fight against terrorism and organised crime.
It is his first trip abroad since surviving two assassination attempts last month.
On Thursday, he will travel on to the World Economic Forum meeting in the Swiss resort of Davos.
From the newsroom of the BBC World Service