For hundreds of years travelers have haggled over carpets, jewelry, spices and copperwork in the winding alleyways of Khan al-Khalili, Cairo's traditional market. Today, the goods are more likely to have been mass-made in a factory in China than handcrafted in a local workshop.

Trade is central to growing ties between China and the Middle East. It has increased more than 600 percent in the past decade, to $230 billion in 2014. Bahrain, Egypt, Iran and Saudi Arabia all import more from China than from any other country. China is the top destination for exports from several countries in the region too, including Iran, Oman and Saudi Arabia. In April, Qatar opened the Middle East's first clearing bank to handle transactions in yuan.

The trade is driven by China's thirst for oil. In 2015 it became the world's biggest importer of crude, half of it — more than 3 million barrels a day — from the Middle East. By 2035, China's imports from the region will roughly double again, reckons the International Energy Agency, far exceeding that of any other nation. "This is a big shift rather than incremental change," says Chaoling Feng of Cornell University.

Even the Middle East's poorer countries offer a fertile market for cheap Chinese wares. In 2013, Xi Jinping, China's president, proposed reviving the Silk Road, an ancient trade route linking China to Persia and the Arab world. Chinese cars crowd the streets of the Egyptian, Syrian and Iranian capitals. Chinese-made clothing, toys and plastics are ubiquitous. China sells a lot of small arms too, according to the United States Institute of Peace, a think tank in Washington.

As China looks west, Arab countries turn east. In part, this reflects the revolution in the energy market wrought by fracking. America is relying more on its own shale oil and gas and buying less fuel from the Middle East. In 2000, the region exported 2.5 million barrels of oil a day to America; that dropped to 1.9 million by 2011. By 2035, the International Energy Agency predicts America will buy only 100,000 barrels a day and 90 percent of Middle Eastern oil will flow to Asia.

Arab leaders such as Egypt's Abdel-Fattah al-Sisi are keen to woo Chinese investors. They need cash to fix their crumbling roads and dilapidated ports. Sisi and almost every other Arab head of state have visited Beijing since 2012. Chinese firms are building Tehran's metro, two harbors in Egypt and a high-speed railway between Saudi Arabia's holy cities of Mecca and Medina. Factories in a Chinese-run special economic zone at the Suez Canal churn out plastics, carpets and clothing. On June 15, Egypt and China signed an agreement for $10 billion in new projects.

So far, a purely economic partnership has worked well. Few Arabs worry that China is exploiting the region — a feeling widespread south of the Sahara. But the relationship may change in time. Many leaders in the Middle East fret over a perceived American withdrawal. Although officials recognize that China does not have America's military or diplomatic clout, some want it to help fill the void.

Alan Hakim, a Lebanese minister, says China should play a "leading political role" in the region. The Gulf, which has long relied on America for security, "is looking to diversify our political relations," says an official in the Gulf Cooperation Council, a club of six states. "China is foremost among the targets."

China may not have the soft power of America — despite an Arabic television channel run by the state broadcaster and ever more Arabic-speakers in China — but it is finding admiration in some quarters.

Authoritarians such as Sisi, who took power in a coup in 2013, seek to emulate the Chinese model of economic development without political pluralism. Abusive rulers in the Middle East like the fact that China doesn't nag them about human rights — and return the courtesy. Saudi Arabia forged diplomatic relations with China only months after the massacre of prodemocracy protesters in Beijing in 1989.

Beijing has long espoused a policy of "noninterference" in other countries' internal affairs. It opposed the American-led invasion of Iraq in 2003 and has voted with Russia to block action to end Bashar Assad's rule in Syria. It has tried to remain friendly with both Israel and the Palestinians, and with the regional foes, Iran and Saudi Arabia. It is not taking part in the coalition fighting Islamic State of Iraq and the Levant, despite its oil interests in Iraq and unsubstantiated reports of 300 Chinese Muslims fighting there. "We don't really have the ability to lead in solving Middle East matters, nor have we ever thought about it," says Li Weijian of the Shanghai Institute for International Studies.

It is notable that neither Xi, nor his prime minister, Li Keqiang, has set foot in the Middle East, despite visits across the world. Xi postponed a visit to Saudi Arabia in April, probably to avoid commenting on its airstrikes in Yemen.

But China is finding it ever harder to stay aloof. By vetoing resolutions on Syria, for example, it is seen as one of the powers supporting Assad. Chinese flags were set on fire in various Arab capitals after it vetoed a U.N. Security Council resolution calling for Assad's removal in 2012. Despite the vetoes it is also talking with the opposition in Syria.

And it has started to play a more active role in other parts of the region. It is one of the six countries trying to negotiate a deal to curb Iran's nuclear program, even as it engaged in joint naval exercises with Iran last year.

As its economic interests grow, China may be sucked into the Middle East's snake-pit politics, whether it likes it or not. Last year, President Obama criticized China for avoiding the fight against ISIL. He accused it of having been a "free rider" for too long, offering little in return for a steady flow of oil. Some Arab leaders agree.

Copyright 2013 The Economist Newspaper Limited, London. All Rights Reserved. Reprinted with permission.