One of the few things Obama and Republican candidate Mitt Romney agreed on during their bitter campaign was that US combat troops would pull out by the end of 2014, whatever the state of the conflict against Taliban insurgents.
But in general Afghanistan, where the US has lost more than 2 000 soldiers in a decade of fighting and still has 68 000 troops, was barely mentioned during the election campaign.
There was no immediate reaction from the Afghan government as President Hamid Karzai was travelling, heading for a meeting in Indonesia, and officials said they had no comment on the election result.
But Karzai has said in the past that the outcome would have little impact on Afghanistan as the US strategy towards the country was already set.
And on the streets, indifference ruled.
"For me it really doesn't matter," said Nasrullah, a mobile phone retailer in the insurgency-plagued southern province of Kandahar.
"Whether Obama or Romney, it is the same. (Former president George W) Bush, Obama – none of them could solve the problems of Afghanistan," Nasrullah, who uses just one name, said.
Fazil Mohammad, an elderly man on the streets of Kandahar city, said: "Who cares? I don't care who wins, it's not Afghanistan's election."
Mohammed Sharif Athar, a student of Islamic law in Kabul, said: "All US presidents' policies in Islamic countries have failed because they are there for their own interests. We want our own president to do something."
One of the few with a strong preference, university student Mohammad Haroun, said: "Bush was generous. He spent lots of money in Afghanistan.
"Since Obama has taken over the troubles have increased in Afghanistan, so I'd have preferred Romney, who is a Republican like Bush."
Many among Afghanistan's educated elite are concerned that the country will collapse into civil war after the US-led Nato force of some 100 000 troops pulls out.
Taliban spokespeople were not immediately available for comment on the outcome of the election.
US ambassador James Cunningham told reporters at an election party at the Kabul embassy that Washington would continue to support Afghanistan after the troops withdraw.
"Americans have sacrificed much, and contributed much, in Afghanistan," he said.
"President Obama is committed to our enduring partnership, our Strategic Partnership, with the people of Afghanistan."
Obama and Karzai signed a Strategic Partnership Agreement earlier this year which covers relations after 2014, including the possibility of a reduced force remaining in Afghanistan to help train, advise and assist local forces.
But one crucial aspect of the US-Afghan relationship as yet unresolved is the legal status of any American forces who remain in the country after 2014.
Washington wants its troops to have immunity from prosecution in local courts, but Karzai says Afghans might not accept that.
Negotiations on the issue have been complicated by a murderous rampage in March by a US soldier who allegedly killed 16 Afghan villagers in their homes at night before being flown out of the country.
The soldier accused of the massacre, Staff Sergeant Robert Bales, is facing a pre-trial hearing in the US this week to determine whether he should face a full court-martial.
Other issues, including the burning of Korans at an American base and the deaths of civilians at the hands of Nato forces, mainly through air strikes, have also caused deep resentment among Afghans.
At least 53 Nato troops, mostly Americans, have been killed this year in so-called green-on-blue attacks, in which Afghan forces turn their weapons on their Nato allies.
Against this background, along with the conflict's financial costs, opinion polls in the US have shown dwindling support for the war, with a majority wanting the troops home as soon as possible. – Sapa-AFP