Top Pakistan officials said Obama's comment was irresponsible and likely made for political gain in the race for the Democratic nomination.
"It's a very irresponsible statement, that's all I can say," Pakistan's Foreign Minister Khusheed Kasuri told AP Television News. "As the election campaign in America is heating up we would not like American candidates to fight their elections and contest elections at our expense."
Another presidential hopeful, Colorado Republican Tom Tancredo, also came under criticism Friday by a Pakistani official after saying that the best way to deter a nuclear terrorist attack on the United States would be to threaten to retaliate by bombing the holiest Islamic sites of Mecca and Medina.
Tancredo spoke at a town hall meeting in Osceola, Iowa on Tuesday.
In Washington, the State Department disavowed Tancredo's remarks, which some diplomats fear could damage U.S. ties with the Muslim world and hurt efforts to counter Islamist extremism.
"It is absolutely outrageous and reprehensible for anyone to suggest attacks on holy sites, whether they are Muslim, Christian, Jewish or those of any other religion," deputy spokesman Tom Casey told reporters, adding that the comments were "absolutely crazy."
In Pakistan's national assembly on Friday, Minister for Parliamentary Affairs Sher Afgan said he would open debate next week on recent American criticism of Pakistan, including Tancredo's remarks.
In a speech Wednesday, Obama said as president he would order military action against terrorists in Pakistan's tribal region bordering Afghanistan if intelligence warranted it. Many analysts believe that top Taliban and al-Qaida leaders, including Osama bin Laden, are hiding in the region after escaping the U.S.-led invasion of Afghanistan in 2001.
President Gen. Pervez Musharraf has come under growing pressure from Washington to do more to tackle the alleged al-Qaida havens in Pakistan. The Bush administration has not ruled out military strikes, but still stresses the importance of cooperating with Pakistan.
"There are terrorists holed up in those mountains who murdered 3,000 Americans. They are plotting to strike again," Obama said. "If we have actionable intelligence about high-value terrorist targets and President Musharraf will not act, we will."
Pakistan's state-run news agency reported Friday that Musharraf, asked about the possibility of U.S. military operations in Pakistan, said the country was "fully capable" of tackling terrorists in the country and did not need foreign assistance.
Pakistan used to be a main backer of the Taliban, but it threw its support behind Washington following the Sept. 11, 2001 attacks. Since then, Pakistan has deployed about 90,000 troops in its tribal regions, mostly in lawless North and South Waziristan, and has lost hundreds of troops in fighting with militants there.
On Friday, 1,000 tribesmen rallied in Miran Shah, the main town in North Waziristan tribal area, condemning recent military operations and chanting slogans against the United States.
"We will teach a lesson to America if it attacks us," local cleric Maulvi Mohammed Roman told the rally.