WASHINGTON, June 29 (Reuters) - U.S. President Barack Obama inspires the most confidence of any world leader, according to a global poll released on Monday, with Iranian President Mahmoud Ahmadinejad and Russian Prime Minister Vladimir Putin earning the lowest marks.

The poll of people in 20 countries, which include nearly two-thirds of the world's population, found an average of 62 percent had some or a lot of confidence in Obama to do the right thing in world affairs.

No other world leader inspired confidence from more than 40 percent in the poll. Ahmadinejad, whose disputed re-election has sparked street protests in Iran, had the confidence of 28 percent he would do the right thing, while 49 percent had no confidence in him.

Putin had confidence from 34 percent, while 50 percent did not have confidence in him, the poll found.

"At this moment Obama occupies a unique position in the eyes of the world," said Stephen Weber of WorldPublicOpinion.org, which conducted the survey.

"His communication skills and the change he represents create an open door for him to engage people around the world," he said.

German Chancellor Angela Merkel had the second-highest positive rating behind Obama of any national leader, with an average of 40 percent expressing confidence and 38 percent not having confidence in her.

The ratings for U.N. Secretary General Ban Ki-moon also leaned more positive, 40 percent, than negative, 35 percent.

President Nicolas Sarkozy of France showed improvement from a confidence rating of 30 percent in a 2008 poll to 34 percent this year, although 45 percent did not have confidence in him.

British Prime Minister Gordon Brown had the confidence of 36 percent, with 45 percent giving him negative marks. Chinese President Hu Jintao inspired confidence in an average of 32 percent, while 44 percent did not have confidence.

The poll was conducted in China, India, the United States, Indonesia, Nigeria, Pakistan, Russia, Mexico, Germany, Britain, France, Poland, Azerbaijan, Ukraine, Kenya, Egypt, Turkey, Iraq, the Palestinian territories and South Korea.

The poll of 19,224 respondents was conducted between April 4 and June 12 and had a margin of error of 3 to 4 percent. WorldPublicOpinion.org is managed by the Program on International Policy Attitudes at the University of Maryland. (Writing by John Whitesides; editing by David Storey)