IT ALMOST feels like old times. Before Saddam Hussein invaded Kuwait in 1990, Gulf Arabs partied on the banks of the Shatt al-Arab river in southern Iraq. Many owned villas in the fields around Basra and took Iraqi wives. Now, after a break of three decades, they are back. Saudi Arabia is putting the finishing touches on a consulate in Basra’s Sheraton hotel, where Iraqi crooners sing love songs and waiters dance. Last month a dozen Saudi poets travelled to Basra for a literary festival.

Air links between Saudi Arabia and Iraq have also resumed, with 140 flights each month. Several state-owned businesses, including SABIC, the Saudi petrochemical giant, are registering offices in Baghdad. At a conference in Kuwait last month, the Saudi foreign minister, Adel al-Jubeir, pledged $1bn in loans and $500m in export credit to support Iraq’s reconstruction after the war with Islamic State (IS).

Saudi interest was initially pricked by America, which has been marshalling Gulf support to help stem Iran’s push west. It was a hard sell. Iraq, under Saddam, threatened to invade Saudi Arabia. More recently, it has allowed Shia militias backed by Iran to set up camp on the Saudi border. In response the kingdom, which considers itself the region’s Sunni champion, is accused of bankrolling Sunni jihadists in Iraq.

But Muhammad bin Salman, the Saudi crown prince, is shaking the kingdom from its sectarian logic. In 2015 he was central to restoring diplomatic relations and last year reopened the kingdom’s borders with Iraq. He has shifted money from Sunni politicians to more effective Shia ones. He has even hosted Muqtada al-Sadr, a Shia cleric, and Qasim al-Araji, Iraq’s interior minister who is close to Iran. Diplomats note the disparity in help offered by Saudi Arabia and Iran, which pledged nothing at the conference in Kuwait. “Having failed to outfight Iran, the Saudis now want to outspend it,” says a delighted Iraqi official.

In a country where Shia Arabs make up the majority of the population, Iran has sought influence by stoking sectarianism and gaining the allegiance of Shias. Saudi Arabia wants to win them back by reviving the country’s Arab identity, and setting Iraqis against Persian Iran. Arab nationalism was largely smothered when Iraq’s former ruling Baath party was banned in 2003. Much of the focus is on Basra, which is Iraq’s richest province. Projects earmarked by the Saudis for investment include Basra’s moribund petrochemical plant, which could help wean Iraq off Iranian products. Saudis have also eyed the scrub along the border, which the kingdom wants to turn into fertile fields by tapping underground aquifers. Iraqi officials hope it will finance railroads and reopen the pipeline that, until 1990, shuttled Iraq’s oil to the Red Sea. Southern Iraq has drifted so far into Iran’s orbit that highways are named after the late Ayatollah Ruhollah Khomeini, leader of Iran’s Islamic revolution; Iranian-backed Shia parties rule the roost. But some in Tehran are nervous, recalling how Saudi Arabia goaded Iraq’s Arabs, even Shias, to wage an eight-year war on Khomeini’s Iran beginning in 1980. Iranian businessmen worry about fresh competition for Iraq’s market, their second largest for non-oil products after China. So to tie Iraq even closer, Iran has opened a free-trade zone next to the Shalamcheh crossing near Basra. It has unilaterally lifted visa requirements for Iraqis to ease their shopping sprees in Khuzestan, on the border. The collapse of Iran’s currency has sucked in custom. Iraq imports over 100 times more from Iran than it exports, in terms of value.

Meanwhile, Iranian-backed factions in Iraq are trying to sully the rapprochement with Saudi Arabia. Their politicians cite the 3,000 or so Saudis who joined IS. “How can we welcome our killers?” asks a militiaman in Basra. Clerics in Najaf have dithered on the kingdom’s request to open a consulate in the Shias’ holiest city.

But overall the Saudi charm offensive has proven popular. For all their sectarian bonds with Iranian Shias, the people of Basra fought on the front lines of Iraq’s brutal war with Iran. Many view Iranian engagement as colonisation. And even militias are swayed by the prospect of more commerce. Saudi investors, they hope, will need protection and help dealing with the country’s tortuous bureaucracy.

Haider al-Abadi, Iraq’s prime minister, seems happy to juggle the regional rivalry. His security forces reportedly confiscated posters, printed by a pro-Iranian group, that denounced the Saudi consulate in Basra. But the kingdom may need more reassuring. To date it has done little more than window-shop for potential investments. It will probably wait until after the Iraqi elections in May before signing any deals.

Other Gulf states dismiss Iraq as a corrupt black hole. The young Prince Muhammad, too, might lack the strategic patience to see through his initiative. But if the Saudis were hoping for a quick win, their first football match in Iraq for nearly 40 years offers a salutary reminder. The Saudi players paraded across the pitch in Basra holding Iraqi scarves aloft. In the end, though, they got a thrashing, losing 4-1.