DUBAI - Saudi Aramco expects to raise $6 billion from its three-part bond sale on Wednesday, the oil giant's first foray into the debt markets in three years, a document showed.

Final terms of the deal include $2 billion from a 10-year tranche at 105 basis points (bps) over U.S. Treasuries, $2 billion in 30-year notes at a 145 bps premium and $2 billion in 40-year paper at a 155 bps premium, the document from one of the banks arranging the sale showed.

Demand for the three tranches topped $31.5 billion, drawing over $11 billion for each of the 10- and 30-year tranches and more than $9.5 billion for the 40-year bonds, the document showed.

Saudi Arabia raised $12.35 billion from a much-anticipated secondary share sale in Aramco after increasing the offering, Merrill Lynch, which was in charge of the so-called greenshoe option, said on Wednesday.

The bond sale was Aramco's first since it raised $6 billion from three-tranche sukuk, or Islamic bonds, in 2021, taking advantage of favorable market conditions.

Aramco has long been a cash cow for Saudi Arabia, which is seeking funds to invest in new industries and wean its economy away from oil under its Vision 2030 plan.

Aramco expects to pay out $124.3 billion in dividends for 2024, most of which goes to the government, which directly owns about 81.5% of the company. Its sovereign wealth Public Investment Fund owns another 16%.

With the latest bond sale Aramco joined top firms and governments in the Gulf rushing to markets this year to fund investments. Proceeds will be used for general corporate purposes.

The spreads have tightened from initial guidance of around 140 basis points (bps) over U.S. Treasuries (UST) for the 10-year paper, 180 bps over UST for the 30-year, and 195 bps for the 40-year, IFR reported.

State-owned companies in emerging markets issued dollar-denominated bonds worth $21.4 billion in the first half of the year - up 22% from a year earlier, investment firm Tellimer said in a report.

Saudi state-owned firms led the group with 23% of the overall issuance value, while the government raised $12 billion of dollar-denominated bonds in January and $5 billion in sukuk in May.

Aramco last month was awarded $25 billion worth of contracts for its gas expansion plans. It also said it would buy 10% of Renault and Geely's thermal engines joint venture Horse Powertrain, and announced a non-binding deal with U.S. energy firm Sempra to buy liquefied natural gas.

Aramco had flagged in February it was likely to issue bonds this year.

Its 40-year tranche will become its second-longest dated bonds after $2.25 billion of notes due in November 2070.

(Reporting by Shamsuddin Mohd in Bengaluru, Federico Maccioni and Yousef Saba in Dubai; Additional reporting by Marc Jones in London; Editing by Louise Heavens, David Holmes and Richard Chang)