A visitor looks at an electronic board displaying stock figures at the Tokyo Stock Exchange in Tokyo, Japan, on Thursday, Oct. 17, 2013. Japanese shares rose initially Thursday after the U.S. Congress voted to end the government shutdown and raise the debt ceiling. (Kiyoshi Ota/Bloomberg)

The U.S. debt deal sparked relief around the world Thursday, but happiness was tempered by head-shaking that the world’s largest economy had nearly defaulted on its financial obligations, and President Obama said that the United States’ global standing had been damaged.

World leaders and investors have been puzzled for weeks about the showdown paralyzing Washington, and some had complained that U.S. politicians who lay claim to global leadership were doing little to safeguard international finances. On Thursday, officials and newspapers from Beijing to Madrid said the crisis raised fresh questions about the strength of the American political system.

Obama, meanwhile, said that the shutdown had done great harm. “It’s encouraged our enemies,” he said. “It’s emboldened our competitors. And it’s depressed our friends who look to us for steady leadership.”

World markets were largely lower Thursday after having risen earlier this week on expectations that a deal would be made.

“People aren’t breathing an enormous sigh of relief and thinking, ‘Well, thank goodness that’s over,’ ” said Jonathan Loynes, chief European economist at Capital Economics in London. “I think they are a little astounded at the whole episode and worried that we’ve got months of uncertainty about the debt ceiling ahead of us.”

Congress voted Wednesday to reopen federal agencies, call civil servants back to work and raise the debt ceiling, after a 16-day government shutdown. But the deal leaves negotiators to resolve longer-term budget issues over the next few months, and they will confront the debt limit again in February.

Japan’s main stock market index, the Nikkei, closed Thursday up 0.8 percent, after earlier hitting a three-week high, while Hong Kong’s Hang Seng index fell 0.6 percent. In London, the FTSE-100 index closed up 0.1 percent, while Germany’s DAX closed down 0.4 percent. In China, where the economy is slowing, there were renewed calls for the country to diversify its foreign exchange reserves, which contain $1.3 trillion in U.S. Treasury bonds. There was also recognition that this was easier said than done. On Monday, China’s state-run Xinhua news agency published a commentary calling for a “de-Americanized world.”

The U.S. currency’s dominant position in global finance is still “unshakable,” said Sun Zhe, director of the Centre for U.S.-China Relations at Tsinghua University. But, he said, the “political show” in Washington was still damaging.

“People start to doubt American credit, even the American creed, including the market economy and American democracy, and question whether the U.S. still has the capacity to manage the world economy,” Sun said.

Beijing’s U.S. Treasury bond holdings have fallen slightly in the past year and, more significantly, as a proportion of total reserves in the past decade. The purchase of U.S. Treasury bonds is a virtually automatic consequence of China’s decision to intervene in the foreign exchange market to prevent its own currency, the yuan, from appreciating, analysts said.

“The recoveries of the U.S. economy and the world economy both need a stable policy environment,” Chinese Commerce Ministry spokesman Shen Danyang said at a news conference. “We hope and believe that the U.S. government can reduce the risk [of default], to promote the recovery of the world financial markets, and market stability.”

Elsewhere, countries that have struggled with their own political chaos took a break to watch the spectacle of a no-holds-barred fight in a global superpower that ended with few concrete policy changes.

In Italy, pundits marveled at similarities between the dysfunctional U.S. government and their own frequently paralyzed political system. “How strong, really, is America if it can be taken hostage by a gang of irreducible extremists?” asked Il Sole 24, a financial newspaper.

El Pais newspaper in Spain, where the wounds of the European debt crisis remain fresh, said the deal “only prolongs the time until the next match, has weakened America’s international leadership and has given ammunition for those who opt for a multi-polar world in response to the imminent American decline.”

And in Germany, where a leading economics institute warned Thursday that Europe’s debt crisis could easily flare up again, commentators suggested that Obama’s victory may be fleeting. Television networks focused on the U.S. government’s rising debt, repeatedly broadcasting images of sheets of $100 bills being printed.

“The dispute about the budget has already caused material and immaterial damage,” wrote Munich’s Sueddeutsche Zeitung. Periodic fiscal strife “causes doubts abroad about the capacity of the United States to fulfill its role as a leading power.”

As German political parties hammered out a compromise deal to form a coalition after their own elections last month, the relative comity in their system contrasted with the trench fighting in Washington.

Few analysts around the world seemed to feel that the deal had resolved much of anything in the long term.

“Relief is limited by the fact that this really is kicking the proverbial can down the road,” said Klaus Baader, chief Asia Pacific economist at Societe Generale Corporate & Investment Banking in Hong Kong.

“Hopefully the U.S. political class, and specifically the Republicans, have learned something from this episode, and the next budget negotiations are going to be easier,” Baader said.

Denyer reported from Beijing. Li Qi and Liu Liu in Beijing, Petra Krischok in Berlin, Yuki Oda in Tokyo, Anthony Faiola in Rome, Chico Harlan in Seoul and Karla Adam in London contributed to this report.