Foreign investors flocked back to Saudi Arabia on Tuesday to snap up $12 billion in bonds offered by state oil company Aramco, suggesting that Westerners’ snubbing of the kingdom last year after the killing of journalist Jamal Khashoggi was short-lived.

Aramco plans to use the money to buy most of a petrochemical company from Saudi Arabia’s sovereign wealth fund. That will give the fund additional billions to pursue plans to diversify the economy away from oil — a key aim of Crown Prince Mohammed bin Salman.

State-owned Aramco, which last week disclosed it is the world’s most profitable company, with $111 billion in net income in 2018, drew high demand for its first international bond sale, attracting orders nearly 10 times beyond what it ultimately sold.

But luring the foreign expertise and investment needed to meet the kingdom’s economic diversification goals won’t prove as easy as drawing foreign investors to a bond sale, Saudi experts said.

“There’s a ton of interest in buying Aramco bonds and owning a piece of Saudi Aramco, or at least its debt,” said Jim Krane, an energy studies fellow at Rice University in Houston. “When it comes to actually moving your personnel to the kingdom and opening a franchise there and being subject to Saudi laws and courts, the enthusiasm is quite a bit lower. There’s a lot of questions about rule of law in Saudi Arabia, especially over the last couple of years."

Mohammed, who came to power in June 2017, has promoted the Vision 2030 strategy, which aims to boost domestic manufacturing, increase the number of women in the workforce and build a private sector in industries other than energy, such as tourism, tech and entertainment.

One big goal is to ensure employment for Saudi Arabia’s young population in the private sector and to move workers off the public-sector payroll. More than 60 percent of Saudis are under age 30.

Attracting foreign investors to build factories and establish businesses is crucial to the plan, but such investment has been slow to materialize, said Karen Young, a political economist at the American Enterprise Institute who studies the Persian Gulf states.

“It’s been one of the more disappointing aspects so far,” she said. Foreign direct investment in the kingdom fell steadily in the decade up through 2017, from a high of $39.5 billion in 2008 to only $1.4 billion in 2017, according to World Bank data.

The brutal killing of Khashoggi by Saudi agents last year helped derail some foreigners’ plans to support Vision 2030. Well-known figures from the U.S. tech industry backed away from a project called Neom aimed at building a tech and tourism hub in the northwestern corner of the kingdom.

The CIA concluded that the crown prince was likely to have ordered the murder, contradicting Saudi government claims that he was not involved.

On Monday, the State Department barred 16 people, including members of Mohammed’s entourage, from entering the United States because of their roles in Khashoggi’s killing at the Saudi Consulate in Istanbul last October.

Even before Khashoggi’s murder, some of the kingdom’s actions gave foreign investors pause about the country’s stability and commitment to the rule of law, Krane said.

Some foreign investors were alarmed by the crown prince’s roundup and detention of a host of wealthy Saudis in Riyadh’s Ritz-Carlton hotel in 2017, in what he characterized as an anti-corruption drive, Krane said.

“There was no due process for that, no transparency, and some credible allegations of maltreatment,” he said.

The Aramco sale follows several high-profile bond sales by Middle Eastern governments over the past few years, including Saudi Arabia and Qatar, which also drew strong demand. The governments have touted the popularity of these sales as a vote of confidence in their economies, but Young called that idea "misplaced.”

“The reason why investors are so heavy on gulf issuances is there’s not much else out there that looks safe and has high credit ratings,” Young said.

Saudi Arabia had been planning to sell a small stake in Aramco to help fund Vision 2030, but last year it postponed plans for that initial public offering, in part because some of the crown prince’s advisers opposed the idea, the Wall Street Journal reported. The kingdom has also been wary of the public scrutiny an IPO would bring to Aramco’s finances, analysts say.

Correction: An earlier version of this article misquoted Jim Krane of Rice University about allegations of maltreatment made by Saudis detained at the Ritz-Carlton in 2017. Krane called those allegations “credible,” not “incredible.”