Mr Obama met the governor of Nangarhar province
US Democratic presidential hopeful Barack Obama has met military officials and visited a US base during a trip to Afghanistan.
Mr Obama, who flew to Kabul as part of a US congressional team, is expected to meet Afghan President Hamid Karzai.
He is later expected to visit Iraq, Jordan, Israel, Germany, France and Britain.
Correspondents say Mr Obama is hoping to address security issues, seen as the weakest aspect of his presidential bid.
Opinion polls suggest Americans regard Republican John McCain as a better potential commander-in-chief.
After landing in Kabul, Mr Obama flew by helicopter to the north-east of the country, where he visited troops and US officials.
The area has seen an upsurge in fighting with pro-Taleban rebels in recent months, notably along the border with Pakistan.
Last Sunday, nine US soldiers were killed after a Taleban attack on a remote military outpost in the area.
In a speech earlier this week, Mr Obama promised to commit at least two more combat brigades - up to 10,000 men - to Afghanistan, if he wins November's election.
He also said the US military should focus on that country rather than Iraq.
'One president at a time'
Asked what message he would convey to Afghan and Iraqi leaders, Mr Obama said: "I'm more interested in listening than doing a lot of talking."
TRUSTED ON MIDDLE EAST
Americans with more trust in one candidate than the other to handle the situation involving -
Iraq: McCain 47%, Obama 45%
Iran: McCain 46%, Obama 44%
Israel and the Palestinians: McCain 44%, Obama 42%
Source: Washington Post/ABC News, 10-13 July
Speaking to reporters before leaving, he added: "I'm going over there as a US senator. We have one president at a time, so it's the president's job to deliver those messages."
Mr Obama also said he would talk to commanders both in Afghanistan and Iraq to find out about their concerns.
The BBC's Martin Patience in Kabul says the visit is widely seen as an attempt by the Democratic hopeful to strengthen his security credentials.
He is being accompanied by newscasters from America's major television networks during his foreign tour.
Correspondents say the McCain campaign will seize on every perceived misstep during Mr Obama's trip, and will also point out that Mr McCain's earlier visits to Iraq and elsewhere attracted far less public attention.
In his own foreign policy speech, the Republican candidate said Mr Obama's strategy of winning in Afghanistan by pulling out of Iraq "has it exactly backwards".
"It is precisely the success of the surge in Iraq that shows us the way to succeed in Afghanistan," he said on Tuesday.