WASHINGTON (Agencies) - White House hopeful Barack Obama Tuesday promised to shift the "single-minded" US focus on Iraq to a threatening "terrorist sanctuary" in tribal Pakistan, in a broad new blueprint for US foreign policy. Setting the stage for a major foreign tour designed to bolster his commander-in-chief credentials, Obama called for tough, principled US diplomacy, rooted in his vow to get most US troops home from Iraq in 16 months. He promised to make Iraqis provide for their own security, to strike at Al-Qaeda in Pakistan if Islamabad would not, to secure loose nuclear weapons, combat climate change and end the "tyranny" of US reliance on foreign oil. "Iraq is not going to be a perfect place, and we don't have unlimited resources to try to make it one," Obama said in the speech in Washington. "I will give our military a new mission on my first day in office: ending this war," Obama said, ahead of an expected visit to Iraq and Afghanistan soon, and talks with the leaders of European powers, Israel and Jordan. Obama's Republican opponent, Senator John McCain argues that Obama would squander gains from last year's troop surge strategy by withdrawing troops, and accuses the Democrat of having a closed mind on Iraq strategy. But Obama, who also promised to use diplomacy to end Iran's nuclear programme and renew US alliances, promised to switch the focus of US military action overseas from Iraq, to Afghanistan and Pakistan. "As should have been apparent to President Bush and Senator McCain - the central front in the war on terror is not Iraq, and it never was," he said. "Al-Qaeda has an expanding base in Pakistan that is probably no farther from their old Afghan sanctuary than a train ride from Washington to Philadelphia," Obama said. "If another attack on our homeland comes, it will likely come from the same region where 9/11 was planned. And yet today, we have five times more troops in Iraq than Afghanistan." "By any measure, our single-minded and open-ended focus on Iraq is not a sound strategy for keeping America safe," Obama said. Obama said the greatest threat came from tribal regions of Pakistan. "We cannot tolerate a terrorist sanctuary, and as president, I won't," he said. "And we must make it clear that if Pakistan cannot or will not act, we will take out high-level terrorist targets like (Osama) bin Laden if we have them in our sights. Make no mistake: we can't succeed in Afghanistan or secure our homeland unless we change our Pakistan policy. We must expect more of the Pakistani government, but we must offer more than a blank check to a General who has lost the confidence of his people," Obama said. A poll Monday underlined why Obama needs to improve his standing on national security issues, and why McCain's team senses he is vulnerable. Some 72 per cent of the 1,119 adults surveyed by telephone in the July 10-13 ABC News/Washington Post poll said McCain, a Vietnam War veteran would be a good commander in chief. Only 48 per cent thought the same of Obama. Obama pledged to pursue a tough and smart new national security strategy, focusing not just on Baghdad, but on Kandahar and Karachi, Tokyo, London, Beijing and Berlin. He promised to concentrate on five main goals: "ending the war in Iraq responsibly; finishing the fight against Al-Qaeda and the Taliban; securing all nuclear weapons and materials from terrorists and rogue states; achieving true energy security; and rebuilding our alliances to meet the challenges of the 21st century."