"Pakistan is a part of the solution of the Afghan problem and any effort towards this end minus Pakistan would remain unproductive," Gilani said while speaking at a dinner hosted by Governor of Khyber-Pakhtunkhwa province in Peshawar tonight.
Pakistan supports an Afghan-led and Afghan-owned reconciliation process, he said.
"However, such a process should not destabilise Pakistan," he added.
While Pakistan wants a stable and prosperous Afghanistan, Islamabad has its own interests in the region which it will protect at all costs, Gilani said.
Referring to "security threats" to Pakistan, he said he had called a conference of all political parties in Islamabad tomorrow to evolve a "consensus strategy through collective wisdom".
Gilani convened the meeting against the backdrop of a sharp spike in tensions with the US following allegations by American military chief Adm Mike Mullen that the Inter-Services Intelligence was backing the Haqqani network for carrying out terror attacks in Afghanistan.
Pakistan is a responsible nuclear power and has no demand but "it wants to be treated like a responsible and dignified state", Gilani said.
The government wants to have "friendly and brotherly relations" with neighbouring countries on the basis of mutual respect and honour, Gilani said.
In an apparent response to US threats of unilateral action against militant groups based in Pakistan's tribal belt, Gilani said the country "would not compromise on its integrity and solidarity and the entire nation was united to safeguard the motherland from any aggression".
Meanwhile, Foreign Secretary Salman Bashir today said Pakistan's foreign policy was aimed at promoting peace and security in the region and the world.
Talking to reporters on the sidelines of an event in Islamabad, he said, "We are mindful of our responsibilities and are working for the peace, security and stability of the region." Answering a question about his two meetings with US Ambassador Cameron Munter in the past two days, Bashir said, "We are in contact with them (Americans) and discussing all the issues."