By Sarah McFarlane, Summer Said and Timothy Puko

Saudi Arabia has set up a deal to purchase U.S. liquefied natural gas from Sempra Energy, a new strategic direction for the kingdom as it seeks to establish a footprint in the growing global market for the fuel.

Saudi Arabian Oil Co., known as Aramco, plans to purchase gas from San Diego-based Sempra Energy's Port Arthur project in Texas, the companies said Wednesday, confirming an earlier Wall Street Journal report.

The two companies said their respective subsidiaries, Aramco Services Co. and Sempra LNG, have signed a "heads of agreement," which anticipates the negotiation and finalization of a definitive 20-year sale-and-purchase agreement covering 5 million metric tons each year from the Port Arthur LNG export project under development.

The agreement also includes the planned negotiation and finalization of a 25% equity investment in Phase 1 of the Port Arthur project, Aramco and Sempra said in a news release.

The financial terms of the deal couldn't be determined, people familiar with the matter said earlier.

Aramco had been expected to close a deal to purchase LNG after holding talks with several U.S. producers and a Russian producer in recent months.

It isn't clear whether the gas will be used to power the kingdom's local economy, or sold on to international buyers.

The deal demonstrates how the U.S. energy boom is dramatically changing global trade. Historically, Saudi Arabia has been a major supplier of oil to the U.S. But with the evolution of shale drilling in the U.S., the Energy Department predicts America will become a net energy exporter next year.

Shale has catapulted the U.S. to being one of the top shippers of LNG, with the Energy Information Administration forecasting it will become the world's third-largest exporter this year.

Aramco has signaled that it intends to boost its gas investments by tens of billions of dollars, domestically and internationally, following similar moves by major energy companies. Royal Dutch Shell PLC and BP PLC are reorienting their energy portfolios toward gas as demand growth for it is expected to outpace oil.

Aramco doesn't produce any oil and gas abroad, and while the kingdom's own gas reserves are some of the largest in the world, they are hard to extract and high in sulfur, making them more expensive to process.

"The cheapest gas is in Russia, the U.S. and Qatar," said Thierry Bros, senior research fellow at the Oxford Institute for Energy Studies, adding that if it had been economic and competitive, Saudi Arabia would have exported its own gas years ago.

Saudi Arabia burns some of its oil for power generation, reducing what could otherwise be exported, and has plans to boost domestic gas output to address this.

"The logical economic choice would be to burn gas at home because it is lower cost and cleaner and export the liquids," said Christopher Gonclaves, managing director of energy at U.S. consulting firm Berkeley Research Group LLC.

Write to Sarah McFarlane at sarah.mcfarlane@wsj.com, Summer Said at summer.said@wsj.com and Timothy Puko at tim.puko@wsj.com