Most thought US relations would get better under a president Obama
People outside the US would prefer Barack Obama to become US president ahead of John McCain, a BBC World Service poll suggests.
Democrat Mr Obama was favoured by a four-to-one margin across the 22,500 people polled in 22 countries.
In 17 countries, the most common view was that US relations with the rest of the world would improve under Mr Obama.
If Republican Mr McCain were elected, the most common view was that relations would remain about the same.
The poll was conducted before the Democratic and Republican parties held their conventions and before the headline-grabbing nomination of Sarah Palin as Mr McCain's running mate.
BBC diplomatic correspondent Jonathan Marcus says the results could therefore be a reflection of the greater media focus on Mr Obama as he competed for the presidential candidacy against Hillary Clinton.
The margin of those in favour of Mr Obama winning November's US election ranged from 9% in India to 82% in Kenya, which is the birthplace of the Illinois senator's father.
On average 49% preferred Mr Obama to 12% in favour of Mr McCain. Nearly four in 10 of those polled did not take a view.
On average 46% thought US relations with the world would improve with Mr Obama in the White House, 22% that ties would stay the same, while seven per cent expected relations to worsen.
Only 20% thought ties would get better if Mr McCain were in the Oval Office.
The expectation that a McCain presidency would improve US relations with the world was the most common view, by a modest margin, only in China, India and Nigeria.
But across the board, the largest number - 37% - thought relations under a president McCain would stay the same, while 16% expected them to deteriorate.
In no country did most people think that a McCain presidency would worsen relations.
Some 30% of Americans expected relations to improve under Mr McCain
Oddly, in Turkey more people thought US relations would worsen with an Obama presidency than under Mr McCain, even though most Turks polled preferred Mr Obama to win.
In Egypt, Lebanon, Russia and Singapore, the predominant expectation was that relations would remain the same if Mr Obama won the election.
The countries most optimistic that an Obama presidency would improve ties were US Nato allies - Canada (69%), Italy (64%), France (62%), Germany (61%), and the UK (54%) - as well as Australia (62%), along with Kenya (87%) and Nigeria (71%).
When asked whether the election as president of the African-American Mr Obama would "fundamentally change" their perception of the US, 46% said it would while 27% said it would not.
The US public was polled separately and Americans also believed an Obama presidency would improve US ties with the world more than a McCain presidency.
Forty-six per cent of Americans expected relations to get better if Mr Obama were elected and 30% if Mr McCain won the White House.
A similar poll conducted for BBC World Service ahead of the 2004 US presidential election found most countries would have preferred to see Democratic nominee John Kerry beat the incumbent George W Bush.
At the time, the Philippines, Nigeria and Poland were among the few countries to favour Mr Bush's re-election. All three now favour Mr Obama over Mr McCain.
In total 22,531 citizens were polled in Australia, Brazil, Canada, China, Egypt, France, Germany, India, Indonesia, Italy, Kenya, Lebanon, Mexico, Nigeria, Panama, the Philippines, Poland, Russia, Singapore, Turkey, the UAE and the UK. A parallel survey was conducted with 1,000 US adults.
Polling firm GlobeScan and the Program on International Policy Attitudes carried out the survey between July and August.