For all the Schadenfreude over Dubai—a city, as we hear ad nauseam, that was “built on sand,” as it was smugly summed up with an ironic undergraduate epitaph from the poem “Ozymandias” (“Look on my works, ye Mighty, and despair!”). But we should tone that down, because Dubai built itself in America’s gilded image: a debt-fueled “service economy” pleasure dome of beachfront real estate and megamalls, side-by-side with seething inequality and conflicting belief systems, each tolerant of the other only when shopping.

And if the emirate’s finances are buckling under the weight of its white elephants, they’d invested heavily in our bubble economy, from Barneys to the W Union Square, paying, in retrospect, much too much. The emirate’s biggest American misadventure by far is its 50 percent stake in CityCenter, the $8.5 billion gambling complex opening this week on the Las Vegas Strip. Dubai finally came to its senses last spring, suing owner MGM Mirage for breach of contract and trying to wriggle free, but the two sides eventually settled. CityCenter is presently worth barely half of what its uneasy partners paid for it.

It also looks rather like something that would be built—in Dubai. But for all the chuckles over developments like a suburb of artificial islands in the shape of “the world,” in fact, the resource-poor emirate did exactly what it was supposed to do during a decade when borrowed money was cheap and the price of its neighbors’ oil rose from $20 a barrel before 9/11 to nearly $150 last summer. Just as the bulge-bracket banks, hedge funds, and private equity firms leveraged themselves to the hilt to take advantage of these conditions, Dubai leveraged itself twice over—its debt is greater than its GDP—to build a city expressly designed to separate its neighbors from their money. In hindsight, this sounds crazy, but only in hindsight.

At the time, the Persian Gulf’s oil states were growing at a rate of 6 percent a year, while India was growing at 9 percent, and even African nations were benefiting from the commodities boom, while China couldn’t get enough of their oil. They were all dressed up with no place to go, so Dubai’s leader Sheikh Mohammed bin Rashid Al-Maktoum and his lieutenants set out to build the world’s ultimate crossroads, a trading hub and playpen for the world’s nouveaux riches.

Clearly, they got carried away. But rather than a cautionary tale, Dubai has improbably become the model city of the Middle East. Abu Dhabi, Saudi Arabia, Kuwait, Qatar, and Bahrain are all busy building instant cities and sculpting islands in a bid to finish what it started and divert the world’s new wealth to their own doors. They have the advantage of petroleum reserves, however, to tide them through the downturn.

But Dubai isn’t finished yet, and there’s a lesson in that for us. Dubai might be stalled now, but it leveraged itself into becoming the region’s Hong Kong of sorts, boasting its largest port, largest airport, biggest and most profitable airline (Emirates, which flies the super-jumbo Airbus A380 to New York), and a no-questions-asked philosophy that has made it a smuggler’s paradise. Its melting pot of a middle class is composed of the best and brightest fleeing Lebanon, Iraq, and Iran. Thanks to them, half of Sheikh Mohammed’s experiment has a future.

Most importantly, Dubai is now the Western terminus of what the Royal Bank of Scotland’s chief China economist Ben Simpfendorfer calls the “New Silk Road,” the renewed trade between the Arab-speaking world and China. It’s China’s gateway to new customers in Africa and the Middle East—to whom it hopes to sell all the goods Americans are too tapped out to buy, in exchange for oil. Those are customers America needs if it hopes to get the economy back on track.

One of the great ironies of Dubai is that it was built with money repatriated to the Gulf after 9/11, following the Patriot Act and the ensuing hassles to obtain a visa. America is indirectly responsible for both Dubai’s rise and fall. And we’ll need it to rise again.