A.P.-Moller Maersk A/S agreed to buy LF Logistics for around $3.6 billion, in a move that would give the ocean shipping giant a network of warehouses in Asia and boost its footprint in inland logistics.

Maersk, which moves about a fifth of the world’s containers on its ships, has been reaping the benefits of the rattled global supply strains that have pushed up ocean freight rates to record levels this year and caused backlogs at U.S. ports.

It...

A.P.-Moller Maersk A/S agreed to buy LF Logistics for around $3.6 billion, in a move that would give the ocean shipping giant a network of warehouses in Asia and boost its footprint in inland logistics.

Maersk, which moves about a fifth of the world’s containers on its ships, has been reaping the benefits of the rattled global supply strains that have pushed up ocean freight rates to record levels this year and caused backlogs at U.S. ports.

It has been using acquisitions to expand beyond ocean freight into inland logistics. It wants to capture a bigger share of the market moving goods between Asian and U.S. ports, and then from ports into warehouses or businesses and even the last mile to a person’s home.

“We are buying a company that can serve our customers by providing goods to physical stores and also deliver goods to the door of the consumer that are bought online,” Maersk Chief Executive Soren Skou said in an interview. “LF Logistics can do both and it can do it in Asia in a big way.”

Mr. Skou expects ocean freight rates to fall next year as consumer demand for manufactured goods, especially in the U.S., has started to ease, but sees sustained growth in inland cargo distribution.

“In the next two or three decades you will see a lot of growth in Asia as hundreds of million of people move from poverty into the middle class and consume more,” he said.

By acquiring LF Logistics, an arm of Hong Kong supply-chain manager Li & Fung Ltd., Maersk gains control of a network of 223 distribution centers across Asia and more than 250 customers globally, according to LF’s website. LF also provides freight forwarding services for retailers, manufacturers and other cargo owners. The Wall Street Journal had previously reported a deal was near.

Maersk is a $60 billion company in terms of annual revenue with about $10 billion currently coming from logistics. Mr. Skou said that over the next five years the logistics part will have a much bigger share than what it has today with annual growth expected at more than 10%.

“I don’t know which part will be bigger, but what I know is that we want to change from a company that ships boxes from Hong Kong to Rotterdam to a company that serves our customers across the supply chain,” he said.

The deal is expected to close in 2022. It comes less than six months after Maersk bought two e-commerce logistics companies in August—one in the U.S. and one in Europe—for a total of nearly $1 billion. The acquisition of LF would dwarf these deals but the Copenhagen-based company had already signaled its appetite for bigger acquisitions, bolstered by its strong earnings growth.

Related Video

Warehouses in California’s Inland Empire are a crucial step in the U.S. supply chain. Low warehouse vacancy rates in the area combined with port delays are creating a perfect storm of challenges this holiday season. Photo: Sam Rosenthal The Wall Street Journal Interactive Edition

Maersk reported a profit of $5.44 billion for the September quarter, more than five times the profitit had a year ago when results were weighed down by the economic slowdown resulting from pandemic restrictions. Revenue jumped 68% to $16.61 billion, amid a surge in freight rates.

The LF deal is Maersk’s biggest move so far to boost its inland logistics business which it hopes will eventually bring in half the group’s earnings. At the moment, around 80% of revenue comes from ocean operations.

Maersk is paying more than twice LF Logistics’s value of $1.4 billion in 2019 when Singapore’s Temasek Holdings Ltd. acquired nearly a 22% stake in the business.

Last month, cash-rich Maersk upped its airfreight game, buying German freight forwarder Senator International as well as expanding its air freighter fleet by five planes.

“The Maersk deal will be the springboard for more carriers buying inland logistics and more consolidation in the logistics industry,” said Lars Jensen, chief executive of Denmark-based Vespucci Maritime. “The carriers made a lot of money during the pandemic, they have to park it somewhere and by investing in inland assets they believe they will create more resilient supply chains for their customers.”

Maersk’s top competitor, Geneva-based Mediterranean Shipping Co. on Monday made a $6.4 billion offer to buy the African logistics assets of French-based conglomerate

Bollore SE. If the deal goes through, it will give MSC control of 16 terminals in the Ivory Coast, Ghana, Nigeria and Gabon along with three rail concessions.

France’s CMA CGM SA, the world’s fourth-largest container ship operator, bought in 2019 Swiss-based freight services provider Ceva Logistics AG for $1.7 billion.

Maersk has around 70,000 ocean customers that include U.S. retail chains, car makers, furniture suppliers, electronics makers and clothing importers. But less than a quarter of those customers use the company to move their goods from ports to warehouses and distribution centers.

Maersk signed in early December a four-year contract with British-based consumer products giant Unilever PLC to manage ocean and airfreight transport.

Its last big acquisition was the 2017 purchase of Hamburg Süd for $4.2 billion, which consolidated its position as a leader in container shipping.

Write to Ben Dummett at ben.dummett@wsj.com and Costas Paris at costas.paris@wsj.com