Major Gulf bourses ended lower on Wednesday as oil prices retreated following a more-than-expected rise in stockpiles, while the Egyptian bourse extended gains.

Saudi Arabia's benchmark index fell 0.3%, with petrochemical maker Saudi Basic Industries Corp 2010.SE and Al Rajhi Bank losing 1.2% and 0.3%, respectively.

The market was in the red amid decreasing oil prices and as investors continue to take their profits after the main index reached a multi-year high, said Wael Makarem, senior market strategist at Exness.

"The market could resume its move higher as soon as oil prices show strength again."

Bucking the trend, oil behemoth Saudi Aramco gained 0.8% at 37.7 riyals per share, its highest close since Dec. 17, 2019, fetching a little over $2 trillion valuation.

Aramco said on Tuesday it has signed five memorandums of understanding as part of an initiative to tackle greenhouse gas emissions. 

Also, the oil giant is expected to report its third-quarter earnings on Sunday.

Elsewhere, Banque Saudi Fransi jumped 4%, following a sharp rise in quarterly net profit.

Outside the Gulf, Egypt's blue-chip index rose 0.8%, with top lender Commercial International Bank climbing 3.1%.

All but one of 18 analysts polled by Reuters believe the Egyptian central bank would keep rates unchanged at a meeting on Thursday as it strives to attract portfolio investment while tamping down inflation. 

In Abu Dhabi, the index dropped 0.6%, weighed down by a 1.9% fall in the United Arab Emirates' largest lender First Abu Dhabi Bank, ahead of its earnings.

On the other hand, Fertiglobe, a joint venture between Abu Dhabi National Oil Company and chemicals producer OCI, surged about 18% above its listing price of 2.55 dirhams in its market debut.

Dubai's main share index eased 0.1%, hit by a 4.2% slide in logistic firm Aramex, extending losses for a second consecutive session.

But Dubai Islamic Bank, the country's largest sharia-compliant lender, advanced 1.2%, after it reported a quarterly net profit of 1.21 billion dirhams, up from 1 billion dirhams year ago. 

The Qatari benchmark lost 0.4%, with Commercial Bank shedding 1.8%, while telecoms firm Ooredoo declined 2.4%, ahead of its earnings.

($1 = 0.2723 UAE dirham)

(Reporting by Ateeq Shariff in Bengaluru; Editing by Krishna Chandra Eluri) ((AteeqUr.Shariff@thomsonreuters.com; +918061822788;))