Danish boxship giant A.P. Moller-Maersk is hedging its bets on non-carbon fuel ships.

The world’s second-biggest liner will add up to 60 new vessels to its fleet, many of which will run on liquefied natural gas, a carbon-based propulsion fuel.

The move marks a departure from Chief Executive Vincent Clerc ’s repeated pledge to avoid LNG-powered vessels and focus on methanol-powered ships that emit no carbon dioxide. Maersk’s rivals have ordered LNG vessels, which emit about 25% less carbon than ships burning bunker oil.

The new ships, which will also be able to run on traditional bunker fuel, will be delivered from 2026 to 2030. They will be a mix of charters and purchases of new vessels, which will cost $120 million on average, according to industry executives.

Maersk currently operates more than 700 ships with a capacity to move around 4.3 million containers. The company said its overall capacity will stay the same as it will recycle a number of older ships.

Maersk established itself as a trailblazer in the transition to green shipping when it purchased the first 25 green-methanol ships. But a shortage of promised methanol supplies from Chinese producers led to a change of plans.

Clerc said that the industry will see a mix of fuels including methanol and LNG coexist for a longer period than anticipated while there is a high level of uncertainty on their availability and cost.

“It is very dangerous for us to completely place one bet on one technology,” he told the Journal in an interview. “We have opted with this order for more of a hedging approach to maintain our competitive edge,”

He said Maersk’s targets to cut carbon emissions by a quarter in 2030 and hit net zero emissions by 2040 are on track and they won’t change.

The first of the green-methanol ships was delivered to Maersk last year and the remainder are to be delivered gradually until 2027.

To secure supplies, Maersk has signed agreements with private methanol producers in the U.S., Asia and Europe, as well as the governments of Spain and Egypt. Most of the vessels being ordered by Maersk and others are dual fuel, meaning they also can run on bunker fuel if methanol supplies are low.

Clarksons Research has estimated that it will cost the industry more than $3 trillion to switch to new forms of power. Producing enough carbon-neutral fuels and developing a global refueling network are major challenges.

Prices for green methanol, which isn’t yet widely available as a marine fuel, can run up to twice as much as bunker oil, according to shipowners. Green methanol is an umbrella term covering liquid methanol produced using renewable energy such as wind or solar power.

The European Union plans to introduce carbon-emission taxes for ships coming to or sailing within the continent starting this year, which could help to narrow the bunker oil-methanol price gap, but global efforts to make alternative fuels more attractive are fragmented.

Maersk says it will need well over a million tons of sustainably produced methanol to run its green-methanol ships.

A number of Maersk’s competitors such as France’s CMA CGM and Germany’s Hapag-Lloyd have ordered dozens of LNG-powered vessels as an intermediate step toward cleaner ships.

Maersk on Wednesday reported second-quarter earnings fell to $798 million from $1.45 billion a year prior. The company said rerouting vessels on longer routes around southern Africa’s Cape of Good Hope led to an increase in bunker-fuel consumption and higher operating costs.

Container operators have diverted ships to avoid the Red Sea after Houthi rebels began attacking commercial vessels at the end of last year, creating a shortage of vessels and port bottlenecks while inflating freight rates.

“Market demand has been strong, and as we have all seen, the situation in the Red Sea remains entrenched, which leads to continued pressure on global supply chains,” CEO Clerc said in a statement. Those conditions are expected to continue for the remainder of the year, he added.

Write to Costas Paris at costas.paris@wsj.com and Nina Kienle at nina.kienle@wsj.com