The ruler of the United Arab Emirates, Sheikh Mohammed bin Zayed, is a key American ally who counts on the United States to defend his country.

But he has traveled twice to Russia over the past year to meet with President Vladimir V. Putin, and in June, his country was celebrated as the guest of honor at the Russian leader’s flagship investment forum. Later this month, the Emirati and Chinese air forces plan to train together for the first time, a notable shift for an oil-rich Gulf nation that has long relied on American fighter jets, weapons and protection.

These deepening relationships show how a Middle Eastern leader viewed by the U.S. government as an important partner is increasingly striking out on his own path. American officials have had limited success in persuading Sheikh Mohammed to align with U.S. foreign policy — particularly when it comes to limiting Chinese military ties and isolating Russia after the invasion of Ukraine.

Instead, the Emirates has thrived on inflows of Russian money, oil and gold, fueling a feeding frenzy in real estate in the glittering metropolis of Dubai. The growing ties with both American rivals and expanding economies like India are all in preparation for a world that may someday be no longer dominated by the United States.

“What we’re seeing in the international order is not necessarily a multipolar world, but we’re seeing a more fluid world where things are changing,” Anwar Gargash, a diplomatic adviser to Sheikh Mohammed, told The New York Times recently. In a lecture in Arabic last year, he was much blunter, declaring that Western hegemony was “in its final days.”

Over the past decade, Emirati leaders have grown concerned about Washington’s long-term commitment to the Middle East, which still hosts tens of thousands of American military personnel. They fear a decline in American interest in the region — and the military defense that comes with it — and argue that Washington has not done enough to deter threats from Iran.

But at the same time, they continue to seek greater protection from the United States.

“I think it’s a hard moment,” Dana Stroul, deputy assistant secretary of defense for the Middle East, told The New York Times’s editorial board in June when asked about the Emirati misgivings. The United States is still present in the region, but is “asking our partners to step up and do more, and that is a shift,” she added.

A federation of seven sheikhdoms perched on the Persian Gulf, the Emirates is roughly the size of South Carolina. Though small, it is one of the world’s leading oil exporters, and its sovereign wealth funds control an estimated $1.5 trillion in assets — more than the market capitalization of Amazon.

As its authoritarian rulers test the boundaries of their relationship with Washington, they are relying on the outsize international influence that they have built through wealth.

Emirati rulers wrote the playbook that other Gulf governments — notably Saudi Arabia — are borrowing from as they try to diversify their economies away from dependence on oil and expand their sway overseas, including through sports.

The Emirates moved earlier than its neighbors to pursue a more independent foreign policy and deal more assertively with the United States — a strategy that Saudi Arabia’s de facto ruler, Crown Prince Mohammed bin Salman, has since adopted.

It was a shift that developed partly out of a sense of vulnerability.

Until they united in the 1970s, the disparate territories that formed the Emirates had been British protectorates with a combined population of a few hundred thousand people. The new state was sandwiched between larger neighbors — Iran and Saudi Arabia — and some early observers expected it to be subsumed by them.

Instead, the Emirates turned into a regional power center. Today, Dubai is home to one of the world’s busiest airports, the world’s tallest skyscraper and a port company that operates facilities far beyond the Middle East.

Over the past few years, the Emirati leaders have seized opportunities presented by various calamities — including the coronavirus pandemic and the war in Ukraine — to cement their nation’s status as a triumphant entrepôt, where British multimillionaires mingle with Russian oligarchs and Indian tycoons.

“The whole world knows us now,” Mohammed Al Gergawi, an Emirati government minister, said in a rare appearance on a Saudi podcast last year. “They know our importance, and they know our influence on the world.”

The country’s bolder foreign policy began to emerge a decade ago, when the Arab Spring revolutions toppled regional strongmen around the same time that President Barack Obama declared a pivot to Asia. As the uprisings rearranged the Middle East’s power structure, the Emirates sent soldiers and weapons into the multiple regional wars that ensued.

In 2014, the country launched airstrikes in Libya without notifying the United States, American officials said at the time. And in 2015, after an Iran-backed militia seized control of Yemen’s capital, Emirati forces joined a Saudi-led military coalition to intervene. That war is still continuing, and it has plunged Yemen into one of the world’s worst humanitarian crises.

In 2019, the Emirates declared a withdrawal of their forces in Yemen. That marked the beginning of a period in which the government shifted its rhetoric — if not always its actions — to a softer, economically driven diplomacy and preached peacemaking across a region exhausted by conflict.

The country emphasized de-escalating tensions, particularly with Iran — an approach that Saudi Arabia also embraced when it restored diplomatic relations with Tehran in a deal brokered by China this year.

Emirati frustrations with the United States have continued to simmer, though.

Sheikh Mohammed has not visited the United States since 2017. A deal to buy American F-35 fighter jets stalled in 2021, and the Emirates has sealed a number of agreements to obtain weaponry from other countries since then, including light attack aircraft from China.

“You really want a firm commitment to your security in a very difficult area,” said Mr. Gargash, the adviser to Sheikh Mohammed, calling this an “existential issue.”

The Emirates’ status as a hub for business and tourism hinges on its relative safety in a volatile region.

But in January 2022, the capital, Abu Dhabi, came under drone and missile attacks claimed by the Iran-backed Houthi militia in Yemen. One attack was thwarted with U.S. help — the Americans deployed Patriot missile defenses from an air base. But another attack killed three people, and Emirati officials argued that the American response had been insufficient, with reassurance taking too long.

“Can the American system actually provide you with what you want?” Mr. Gargash said, signaling that he foresees a longer-term problem. “It’s not about Biden. It’s not about Trump. It’s not about whoever comes later.”

At a conference in the Gulf nation of Bahrain in November, Brett McGurk, a senior White House official handling Middle East policy, said he heard constant concerns about the American commitment to the region.

“We unquestionably are here to stay,” he said.

Russia’s invasion of Ukraine last year brought these tensions to the forefront.

The Emirates, along with many other countries, has made clear that it will not be forced to take sides. And Emirati officials argue they must keep dialogue open with Russia to pursue peace efforts and mediation.

When the Emirates abstained from a U.N. Security Council vote condemning Russia shortly after it invaded Ukraine, critics “came up with this phrase of ‘fence-sitting,’” said Mohammed Baharoon, head of B’huth, a Dubai research center.

“It presumes there is a good side and a bad side — you have to choose one, our way or the highway,” he said.

Nevertheless, the top priority of Emirati leaders is still “to ensure that the U.S. has a greater stake in the region, not a lesser stake,” said Dina Esfandiary, a senior adviser at the International Crisis Group for the Middle East and North Africa.

Indeed, some of the Emirati foreign-policy shifts have been firmly in line with the interests of the White House. The Emirates was the Gulf’s earliest proponent of normalizing relations with Israel, which it did in 2020 in a deal brokered by Donald J. Trump.

At the same time, a gradual decline in American soft power is palpable across the Middle East, local scholars and businesspeople say.

A recent survey sponsored by a Dubai-based public relations firm asked Arab youth which country had the most influence over their region. About a third of respondents said it was still the United States. But the second-most-common answer was not China or Russia — it was the Emirates.

Eric Schmitt contributed reporting from New York, and Ahmed Al Omran from Jeddah, Saudi Arabia.