Mr Obama said Pakistan must do more to tackle al-Qaeda

Mr Obama made the comments in a speech outlining his foreign policy positions.

Pakistan's foreign ministry said any threat to act against al-Qaeda from within its territory should not be used for political point-scoring.

Earlier this month, Mr Obama's chief rival, Hillary Clinton, described him as "naive" on foreign policy.

The attack from Mrs Clinton came after a televised debate between Democrat presidential hopefuls.

If we have actionable intelligence about high-value terrorist targets and President Musharraf won't act, we will

Barack Obama

During the debate Mr Obama said he would be willing to meet leaders of states such as Cuba, North Korea and Iran without conditions.

In his speech at the Woodrow Wilson International Center for Scholars, in Washington, Mr Obama criticised the Bush administration's focus on al-Qaeda in Iraq, saying US President George W Bush was "confusing" the mission.

He said Americans were more vulnerable to terrorist attacks than before the 9/11 attacks because of a war in Iraq "that should never have been authorised and should never have been waged".

"The first step must be getting off the wrong battlefield in Iraq, and taking the fight to the terrorists in Afghanistan and Pakistan," he said.

Aid conditions

Mr Obama said General Pervez Musharraf, Pakistan's president, must do more to end terrorist operations in his country.

He said he would make the hundreds of millions of dollars in US military aid to Pakistan conditional on the following actions by the Pakistani government:

substantial progress in closing down terrorist training camps

evict foreign fighters

prevent the Taleban from using Pakistan as staging area for attacks in Afghanistan

"If we have actionable intelligence about high-value terrorist targets and President Musharraf won't act, we will," Mr Obama said.

The BBC's Jonathan Beale, in Washington, says such comments are clearly designed to bolster his credentials among a domestic audience.

But a spokeswoman for Pakistan's foreign ministry, Tasnim Aslam, told the AFP news agency that talk of military action was a serious matter and political candidates and commentators should "show responsibility".

White House spokesman Tony Snow defended Pakistan's leadership, saying it was working hard to fight al-Qaeda and Taleban fighters within its borders.

Gen Musharraf has been a key US ally in its so-called "war on terror" since the 11 September 2001 terrorist attacks.

But US officials have publicly said recently that they believe Pakistan has let al-Qaeda and Taleban militants reorganise themselves in tribal areas bordering Afghanistan.