Pakistani President Pervez Musharraf said on Friday Pakistan and India should stay steadfast against hardliners and terrorists opposed to a peace process between the two old rivals.
Musharraf told a news conference relations with India had never been better and he was "reasonably optimistic" about their three-year-old peace process but there was a danger of setbacks.
"I think there is good optimism towards a resolution but we have to tread the ground carefully so that we don't slide back," he said.
The nuclear-armed neighbours have fought three wars since their independence in 1947 and nearly went to war a fourth time in 2002.
Tension has eased since they began peace talks in early 2004 but progress has been slow, including on their core dispute over the divided Himalayan region of Kashmir, where Muslim terrorists have been fighting Indian rule since 1989.
Musharraf, in an apparent reference to the terrorists who have for years enjoyed Pakistani support, said some people were opposed to the peace process.
"We cannot take the people who are on confrontationist course, who think that it is only military, it is only militancy, which will solve the problem," he said.
"They can't be on board. So they will remain opposed to whatever we do and they will create all obstacles. We have to be steadfast against what they all do."
Musharraf's remarks came after a top separatist leader from Kashmir, Mirwaiz Umar Farooq, called during a visit to Pakistan last month for the terrorist groups to support the peace process.
Suspected Muslim terrorists on Wednesday threw a grenade at Farooq's office in Srinagar. No one was hurt.
Last month, the Indian and Pakistani foreign ministers met in Islamabad reviving momentum in the peace process that had been stalled by deadly bomb blasts in Mumbai in July. The blasts were blamed on terrorists linked to Pakistan.
"Since the will is being shown, there is a forward movement and I will repeat again that there is a degree of optimism," Musharraf said.
India claims the whole of Kashmir. Pakistan has long sought the implementation of UN resolutions calling for the people of Kashmir to decide if they want to join India or Pakistan.
Kashmir is a highly sensitive issue in Muslim Pakistan and no government can afford to be seen to be giving in on it.