Foreign money is flowing into the parts of the Middle East which need it least as the Gulf becomes a major destination for global portfolio investors and political instability deters investment elsewhere in the region.
When uprisings swept across Egypt, Tunisia and other Arab countries more than two years ago, the Arab Spring looked as if it might have a very different impact.
By clearing out corrupt rulers and installing democratic governments focused on raising living standards, the uprisings promised to open markets to more competition and attract fresh foreign investment in much of North Africa and the Levant.
The Gulf, which escaped major political change, seemed to offer less exciting opportunities as conservative monarchies girded themselves to resist the threat of unrest, backing away from politically sensitive reforms of their economies.
But since 2011, investors have voted in favour of the Gulf by a landslide. Gulf equity and debt markets have boomed, partly on the back of inflows of foreign money, while markets affected by the Arab Spring have struggled.
The contrast was underlined last week when equity index compiler S&P Dow Jones Indices upgraded Qatar and the United Arab Emirates to emerging markets from frontier market status, after a similar decision by MSCI in June.
The decisions, which are expected to attract hundreds of millions of dollars of fresh foreign money to those two markets, put the Gulf on the map for the first time in the eyes of some foreign funds which follow the S&P and MSCI benchmarks.
The upgrades are part of a trend in which foreign investors are increasingly looking at non-oil sectors of Gulf economies as well as their energy riches, fund managers said at the Reuters Middle East Investment Summit.
"Gulf countries have started to attract the interest of international investors beyond the area of gas, oil and hydrocarbons," said John Sfakianakis, chief investment strategist at MASIC, a Riyadh-based investment firm.
Politics have been key. Many investors underestimated the seriousness of sectarian tensions uncovered by the Arab Spring; few expected that 2-1/2 years later, Syria's civil war would still be underway, Egypt would lack a democratic government and Libya would lack any government able to assert its authority.
At the same time, Gulf governments have done better than many expected in maintaining political stability. Massive state spending programmes, financed by oil revenues, have mostly been successful in buying social peace.
Other factors are involved. The euro zone debt crisis and uncertainty over U.S. economic policy have hurt Arab countries with weak external trade positions and state finances while rewarding those, including the Gulf states, which enjoy the security of current account and budget surpluses.
Estimates by Lipper, a Thomson Reuters company, show that even as money flowed out of many emerging market funds in the third quarter of this year, pure Middle East equity funds - most of them Gulf-focused - saw a third straight quarter of net inflows. The sector had not managed that feat since 2007/2008.
In the nine months to end-September, net inflows reached more than $200 million, equivalent to 12.5 percent of the latest reported assets under management, according to Lipper.
Mark Mobius, Executive Chairman of Templeton Emerging Markets, said the strong performances of Gulf economies in the past few years had caused some foreign investors to understand the region better and distinguish between individual markets.
"People understand there is a difference between Dubai and Oman, or Bahrain and Qatar, for example - they can differentiate between them. That's very important."
A third factor buoying Gulf markets is the growth of the private sector. Political tensions have discouraged radical economic reforms, such as cuts in wasteful and expensive state subsidy schemes, across the Middle East and North Africa.
But in the Gulf, governments have been prompted to step up efforts to create jobs for their citizens with labour reforms, financial aid for entrepreneurs and in some cases deregulation, such as Saudi Arabia opening up its aviation market.
As Gulf economies slowly diversify, they become more interesting to foreign investors and more able to ride out drops in oil prices. Output of Saudi Arabia's oil sector shrank 3.7 percent year-on-year in the second quarter of 2013 but the non-oil private sector expanded 4.2 percent, resulting in a solid overall economic growth rate of 2.7 percent.
The growing market clout of the Gulf's private sector was seen last month when UAE shopping mall operator Majid Al Futtaim became the first issuer from the Middle East other than a bank to sell a hybrid bond - one with equity-like characteristics - in the international market.
British-based investors bought 43 percent of the $500 million issue, followed by other Europeans with 28 percent and Asian investors with 12 percent. Just a couple of years ago, local Gulf investors could have been expected to buy most of a bond issue from the region as many foreigners stayed away.
The gradual increase of foreign portfolio investment in the Gulf could become a flood if Saudi Arabia decides to open its market, the Arab world's largest, to direct foreign investment after several years of preparing for the reform. Foreigners are now limited to investing via swaps and exchange-trade funds, and are believed to hold no more than 5 percent of the stock market.
Sfakianakis said any decision to open the Saudi market would be politically sensitive because foreigners might be perceived as unfairly taking some of the country's corporate wealth. "If it happens, it could happen in a second - over a weekend."
Another issue is whether Gulf markets can list enough corporate assets to satisfy foreign investors. In Saudi Arabia, much of the economy is controlled by family firms which float few if any of their shares; in Qatar, the government holds big, untraded stakes in many companies.
Officials in both countries say they want to make more shares available for trading, but once again, progress may be slowed by political sensitivities.
With the S&P and MSCI upgrades due to take effect next year, however, the trend of rising foreign portfolio investment in the Gulf may continue for some time.
The biggest threat may be oil prices. Any drop of Brent crude to around $85 a barrel, from about $105 at present, would start to pressure the finances of Gulf states while aiding the economies of oil-importing Arab Spring countries such as Egypt.
Sfakianakis said any major flow of foreign funds back to North Africa was unlikely without a political breakthrough.
"The politics is what directs the conditions in these countries. Without fixing the politics, and creating a process of decision-making that is based on compromise and rejects extremes on both sides, there will be little economic growth and little attention from outside investors," he said.For all the latest banking and finance news from the UAE and Gulf countries, follow us on Twitter and Linkedin, like us on Facebook and subscribe to our YouTube page, which is updated daily.
Subscribe to Arabian Business' newsletter to receive the latest breaking news and business stories in Dubai,the UAE and the GCC straight to your inbox.