The government will take action wherever and whenever its writ is challenged, Gilani said last night during an appearance on Prime Minister Online, a monthly TV show in which the Premier interacts with callers from across the country.
Asked about reports that a military operation is imminent in North Waziristan tribal agency, he said: "We will think whether there is any need for it. We will not interfere in the matter unnecessarily."
He said the government is not taking dictation from anybody for action in North Waziristan.
"We are not fond of any military action and we want to have an exit strategy," he added. Gilani said his government is following the policy of "dialogue, development and deterrence" to bring militants into the mainstream. His remarks follow media reports that said Pakistan had agreed to a US demand to launch an operation in North Waziristan.
The government had earlier refused to launch an offensive in the region despite intense pressure from Washington. Gilani further said his government is ready to hold dialogue with militants provided they decommission themselves and surrender their weapons.
"But if they (militants) will challenge the writ of the government, target innocent people and attack cities, public property, installations, police stations and railways, the government will take action against them," Gilani said.
The government is determined to act against those who work against Pakistan's sovereignty and will not allow anybody to use the country's soil for acts of terrorism, he said.
"We will make Pakistan free of terrorism," he said, adding it is not in the national interest to have sympathy for Osama bin Laden, who was killed in a US raid in the garrison city of Abbottabad on May 2.
The government is working to frame a comprehensive strategy so that all institutions complement each other's efforts in the war on terrorism and share information to preempt terrorist acts and provide foolproof security, he said.
Responding to a question, Gilani said US drone attacks are unacceptable as they are "against Pakistan's sovereignty, public opinion and the spirit of resolutions passed by Parliament".
These attacks are counter-productive as they affect Pakistan's strategy to separate tribesmen from militants.
The unilateral US action in which Osama bin Laden was killed too was unacceptable, he said. Asked about the trust deficit in Pakistan-US relation, Gilani said the countries have a strategic partnership though "there are ups and down in our relations".
After US Secretary of State Hilary Clinton's recent visit to Pakistan, relations between the CIA and ISI have been repaired, he said.
Why Pak scribe Saleem Shahzad was silenced
Catch Kashmiri, Omar by July: US warns Pak
Pak constitutes commission to probe Osama killing
Rana trial: Impact on India and NIA's next step
Did not attend funeral of Headley's father: Gilani