KABUL, Afghanistan (AP) -- Democratic presidential candidate Barack Obama pledged steadfast aid to Afghanistan in talks with its Western-backed leader Sunday and vowed to pursue the war on terror "with vigor" if he is elected, an Afghan official said.
On the second day of an international tour designed to burnish his foreign policy credentials, Obama and other U.S. senators held two hours of talks with President Hamid Karzai at his palace in the Afghan capital.
Obama has chided Karzai for not doing more to build confidence in the Afghan government, whose grip remains weak after the ouster of the Taliban in 2001.
U.S. Embassy spokesman Mark Stroh said the senators had discussed issues including the painstaking rebuilding of the country's government and economy, the security situation and corruption with Karzai.
The Afghan presidency said Obama's message was positive.
"Sen. Obama conveyed ... that he is committed to supporting Afghanistan and to continue the war against terrorism with vigor," said Humayun Hamidzada, Karzai's spokesman.
Both Democrats and Republicans "are friends of Afghanistan and no matter who wins the U.S. elections, Afghanistan will have a very strong partner in the United States," Hamidzada said.
Obama has made Afghanistan a centerpiece of his proposed strategy for dealing with terrorism threats.
The Illinois senator has said the war in Afghanistan, where Taliban and al-Qaida-linked militants are resurgent, deserves more troops and more attention as opposed to the conflict in Iraq.
While officially part of a congressional delegation on a fact-finding tour also expected to take him to Iraq, Obama traveled in Afghanistan amid the security accorded a likely Democratic nominee for president rather than a senator from Illinois.
Media access to Obama was limited, and his itinerary in the war zones was closely guarded. Traveling with him were Sens. Chuck Hagel, a Nebraska Republican, and Jack Reed, a Democrat from Rhode Island.
Obama made no public comment after the meeting with Karzai, which included a traditional lunch of mutton, chicken and rice washed down with a yogurt drink.
Earlier in the day, he praised U.S. troops during breakfast with soldiers at Camp Eggers, a heavily fortified military base in the city.
"To see young people like this who are doing such excellent work, with so much dedication ... it makes you feel good about the country," Obama said.
"I want to make sure that everybody back home understands how much pride people take in their work here and how much sacrifice people are making. It is outstanding," he said in footage filmed by the military and obtained by The Associated Press.
On Saturday, the delegation received briefings from U.S. commanders and a former Afghan warlord who is now the governor of Nangarhar, a province in eastern Afghanistan where militant attacks are spiraling.
Obama's first overseas tour since securing the Democratic nomination - he is scheduled to travel to Europe through next week - could be key to honing his foreign policy strategy with less than four months before the Nov. 4 election. His rival for the presidency, Republican Sen. John McCain, has criticized Obama for not spending more time in the region.
Obama advocates ending the U.S. combat role in Iraq by withdrawing troops at the rate of one to two brigades a month while increasing the military commitment to Afghanistan. Obama has proposed sending two more combat brigades - about 7,000 troops - to Afghanistan. McCain also is advocating sending more forces to the war-battered country.
U.S. military officials say the number of attacks in eastern Afghanistan, where most of the U.S. forces in the country operate, has increased by 40 percent so far this year compared to the same period last year.
Gen. David Petraeus, the top U.S. commander in Iraq, told The Associated Press on Saturday that after intense U.S. assaults there, al-Qaida may be considering shifting focus to its original home base in Afghanistan, where American casualties are recently running higher than in Iraq.
Obama also has expressed weariness with efforts by Afghanistan's neighbor, Pakistan, to go after militants in its territory. That frustration may strike a chord with Karzai, who has accused Pakistan's intelligence service of supporting the Taliban insurgency - a claim that Pakistan denies.
But Obama also has chided Karzai and his government, saying it had "not gotten out of the bunker" and helped to organize the country or its political and security institutions.