“It’s kind of nice to feel good about the United States again,” said Armando Díaz, 24, a bookkeeper in Caracas, Venezuela, where Enrique Cisneros, a storekeeper summed it up like this: “A few hours ago, the world felt like a different place.” In Iran, too, some said the American example should persuade politicians closer to home to adopt similar political ways.

‘’His election can be a lesson for the dictators of the Middle East,” said Badr-al-sadat Mofidi, the deputy editor of the daily Kargozaran newspaper. Some in Iran focused on their hopes for a change in American attitudes towards their country. ‘’The nightmare of war with the United States will fade with Obama’s election,” said Nehmat Ahmadi, a lawyer.

Indeed, for many who had watched this campaign from afar, there was a sense that the election was not just an American affair but something that touched people around the world, whatever their origin. “I want Obama to win with 99 percent, like Saddam Hussein,” said Hanin Abu Ayash, who works at a television station in Dubai and monitored early returns on his computer. “I swear if he doesn’t win, I’m going to take it personally.”

In Berlin, Anna Lemme, a 29-year-old architect, said she did not usually hurry to catch the news first thing in the morning. ‘’But this morning I jumped to the radio first thing at 5 a.m.,” she said.

There was little doubt that for some, Mr. Obama’s skin color made his victory all the more exhilarating.

“The United States is choosing a black man as its president. Maybe we can share a bit in this happiness,” Mr. Cisneros said in Caracas.

The Afghan president, Mr. Karzai, said the election had shown the American people overcoming distinctions “of race and color while electing their president” and thereby helping to bring “the same values to the rest of the world sooner or later.”