By Maureen Farrell in New York, Benoit Faucon in London and Summer Said in Dubai

Saudi Arabia’s state-owned oil giant and Google parent Alphabet Inc., two of the world’s biggest companies, are in talks about jointly building a large technology hub inside the kingdom, people familiar with the potential deal said.

As part of the potential joint venture, Alphabet would help Saudi Arabian Oil Co., known as Aramco, build data centers around Saudi Arabia, the people said. It isn’t clear specifically whose data the centers would house or who would control them.

Senior executives at Aramco and Alphabet have been in talks for months on the potential joint venture, these people said. The talks have included Alphabet Chief Executive Larry Page and have been encouraged by Crown Prince Mohammed bin Salman, who is enamored with Silicon Valley and wants to bring more tech expertise to the kingdom, some of the people said. Prince Mohammed has been leading the kingdom’s plan to take Aramco public.

Still, there are many details to work out, and it is unclear when — or whether — such a deal will be finalized, the people said.

The size of the potential joint venture is unclear, although it could be big enough to become listed on Saudi Arabia’s stock exchange, one of the people said.

An alliance would help bolster the development of the technology sector in Saudi Arabia, a goal Prince Mohammed has pointed to as a key part of his plan, known as Vision 2030, to wean the kingdom off its reliance on oil.

Alphabet’s Google is chasing both Amazon.com Inc. and Microsoft Corp. in the business of renting computing power and storage online, and a joint venture with Aramco would give it a key foothold in Saudi Arabia as it rushes to develop its tech sector. None of the three companies have massive data-center complexes, known as “regions” in industry parlance, in the area, though Amazon has plans to open one in Bahrain and Microsoft has announced it will open two data-center operations in South Africa this year.

Amazon is also close to finalizing a $1 billion deal to build three data centers in Saudi Arabia, people familiar with that deal said. The deal is expected to be announced during a trip to the U.S. by Prince Mohammed early this year.

A data-center region in Saudi Arabia could potentially help Google win business from oil-industry customers that are looking to shift their computing operations to the cloud. The costs for such centers can run into the hundreds of millions of dollars.

Most data for the Middle East is piped from Europe, slowing surfing to the most-trafficked websites, which are accessed via long-distance undersea cables, according to a person familiar with the Alphabet-Aramco talks. Local data servers — which would store content but also cached memory of personal navigation data, cookies or social-media content — would speed up access and help the country be more competitive in the digital economy.

Alphabet and other digital giants have been reluctant to set up physical data centers in the Middle East, Africa and most of Asia because of data-protection concerns — unlike in the U.S., police generally don’t need a court order to access private data, the person said.

Internet experts say a lack of protection for online data users in Saudi Arabia and other Gulf countries remains an obstacle for the establishment of mass storage by U.S. internet giants and, more broadly, the region’s competitiveness in the internet economy. “Data servers located geographically close to customers means the speed of access is much higher,” said Emily Taylor, an associate fellow researching internet governance and privacy at British institute Chatham House.

Aramco is in the middle of planning for an initial public offering that the government has pegged for this year, though it is unclear whether it will get done in that time frame.

Prince Mohammed has said the proceeds from the IPO would be used to invest outside of the oil industry.

“The future business case for oil is slowly shifting from energy to how much technology can boost the oil sector’s productivity,” said Sam Blatteis, chief executive of MENA Catalysts Inc., a Middle East public-policy advisory and research firm, and who was Google’s head of Gulf government relations until July of last year. “Technology is driving a dramatic reordering of the oil arena, becoming the single most important driver of innovation, competitiveness and growth.”

While a potential joint venture between Alphabet and Aramco isn’t necessarily connected to the latter company’s IPO, if a deal is struck before the offering, advisers to the company could pitch the pact as a way for investors to bake in technology valuations.

Because of the outperformance of the technology sector and tech companies’ massive growth potential, investors have often been willing to value firms higher if they can successfully pitch themselves as technology companies. It is unclear whether Aramco would seek to do this in its IPO.

Since Prince Mohammed announced the stock-offering plan and his $2 trillion estimate for the company’s total valuation in early 2016, insiders and outsiders have questioned how he arrived at that number. Advisers on the deal have said that even with a rebound in oil prices, investors will struggle to value the company in excess of $1.5 trillion.

–Jay Greene and Nicolas Parasie contributed to this article.

Write to Maureen Farrell at maureen.farrell@wsj.com, Benoit Faucon at benoit.faucon@wsj.com and Summer Said at summer.said@wsj.com

Breaking the story

Maureen Farrell, Benoit Faucon and Summer Said were first with the news that Saudi Arabia’s state-owned oil giant, Aramco, and Google parent Alphabet Inc. are in talks about a potential joint venture to build a large technology hub in Saudi Arabia, according to sources.

Email *Please fill in the required field. By clicking submit, I agree to the Privacy Policy and Cookie Policy and I understand I will receive marketing communications from Dow Jones professional information products from which I may unsubscribe using the links provided.

Thank you

Thank you for subscribing, your information has been submitted successfully.