WASHINGTON (Reuters) – Democratic presidential candidate Barack Obama said on Tuesday a “single-minded” focus on Iraq was distracting the United States from other threats, and he promised to end the war and shift resources to fighting al Qaeda and the Taliban in Afghanistan.

Obama, embroiled in sharp debate with Republican White House rival John McCain over Iraq, said the lengthy commitment of combat troops there diminished U.S. security and standing in the world.

“By any measure, our single-minded and open-ended focus on Iraq is not a sound strategy for keeping America safe,” Obama said in a speech designed to lay out his views on the war ahead of his planned trip to Afghanistan and Iraq soon.

“As president, I will make the fight against al Qaeda and the Taliban the top priority that it should be,” Obama said. “This is a war that we have to win.”

The future of Iraq promises to be a central issue in the November election battle for the White House between McCain, a staunch advocate of the war, and Obama, an early opponent of the U.S. invasion.

Obama criticized McCain, an Arizona senator, and U.S. President George W. Bush for making Iraq the center of the battle against terrorism and said he would pursue a new national security strategy to rebuild foreign alliances and regain global goodwill destroyed by the war.

“I am running for president of the United States to lead this country in a new direction — to seize this moment’s promise,” the first-term senator from Illinois said.

Obama also promised a renewed effort to seize nuclear materials from terrorists and “rogue” nations, and said he would be willing to use “all elements” of U.S. power to pressure Iran on its nuclear program.

McCain has suggested Obama is wavering on his pledge to withdraw U.S. combat troops from Iraq within 16 months, pointing to Obama’s recent comment he might “refine” his policies on Iraq based on consultations with military commanders.

But Obama emphasized that while he is open to tactical adjustments, the 16-month timetable remains his goal. He said their disagreement on Iraq was indicative of a different approach to diplomacy and national security.

“Senator McCain wants to talk of our tactics in Iraq; I want to focus on a new strategy for Iraq and the wider world,” he said.

The renewed debate on Iraq came as bombers killed around 40 people and wounded scores in several attacks in northern Iraq, days after the government vowed to expand a crackdown against militants in a region where al Qaeda retains influence.

Second Trip to Iraq

McCain criticized Obama for giving a speech on Iraq before traveling there. Obama has visited Iraq once, in 2006, and has never been to Afghanistan. His trip follows criticism from McCain that he should visit the area and talk to commanders.

“I note that he is speaking today about his plans for Iraq and Afghanistan before he has even left,” McCain said in New Mexico. “In my experience, fact-finding missions usually work best the other way around: first you assess the facts on the ground, then you present a new strategy.”

He said Obama had opposed Bush’s increase in troops in Iraq and predicted its failure, but now conceded it had reduced violence. “My friends, flip-floppers all around the world are enraged,” McCain said. “Today we know he was wrong. The surge has succeeded.”

A Washington Post/ABC News poll released on Tuesday found Americans evenly divided on the candidates’ positions on Iraq with 47 percent of those polled saying they trust McCain more to handle the war, and 45 percent having more faith in Obama.

Obama has proposed adding two U.S. combat brigades, about 9,000 troops, to the 36,000 troops already in Afghanistan and said this would be made possible by a drawdown of troops from Iraq.

In New Mexico, McCain also said the security situation had deteriorated in Afghanistan and promised to bolster the war effort there. An attack on a U.S. base near the Pakistan border by a resurgent Taliban on Sunday killed nine U.S. soldiers and wounded 15, the biggest single American loss there since 2005. “That’s no way to run a war,” McCain said.