He was speaking in a CBS interview, as the White House prepares to unveil a comprehensive strategy for Afghanistan.
Mr Obama said preventing attacks against the US remained its "central mission" in Afghan operations.
Earlier, the US envoy to Afghanistan and Pakistan said US policy would no longer treat the two separately.
Mr Holbrooke said Taleban sanctuaries in Pakistan's tribal areas along the Afghan border were the primary problem for Kabul.
He also said that the era of "neglect" of the region was over, promising more troops and resources.
"What we're looking for is a comprehensive strategy [for Afghanistan]," President Obama told the CBS programme 60 Minutes on Sunday.
Mr Obama - who last month ordered the deployment of additional 17,000 US troops to Afghanistan - acknowledged that military force alone would not be enough to achieve Washington's objectives, which included the defeat of Taleban and al-Qaeda militants.
He said an effective strategy could include building up economic capacity in Afghanistan and improving diplomatic ties with Pakistan and other regional players.
But Mr Obama stressed that Washington "can't lose sight of what our central mission is".
"Making sure that al-Qaeda cannot attack the US homeland and US interests and our allies. That's our number one priority."
He said the central task was the same as when US troops went into Afghanistan after the 11 September 2001 attacks.