South Korea's ailing shipbuilders have been thrown a lifeline in an increasingly tough market with a $19 billion order from Qatar Petroleum (QP) for liquefied natural gas (LNG) ships, analysts said on Tuesday.

Qatar's state-run LNG producer signed agreements with South Korea's "Big 3" shipyards on Monday to secure more than 100 ships through 2027, in the largest-ever single LNG vessel order.

With a steep market downturn on the horizon, the orders had come at the right time for Daewoo Shipbuilding & Marine Engineering Co Ltd, Hyundai Heavy Industries Holdings Co Ltd and Samsung Heavy Industries Co Ltd, analysts said.

"They would have been worrying about their own survival next year if they didn't win this Qatar deal," said Lee Dong-heon, an analyst at Daishin Securities, who estimated the trio would now have an order backlog stretching a year-and-a-half.

Shares in the three shipbuilders rallied over 20% on Tuesday.

"This is the largest single LNG vessel order in history. We have never seen so many LNG vessels ordered in the same year, let alone by a single buyer," said Saul Kavonic, analyst from Credit Suisse.

The industry has been suffering from a prolonged shipbuilding slump that has led to massive losses, job cuts and a bailout from the government. Lee said market forecasts had indicated a 30% fall in orders this year from a year ago.

Park Moon-hyun, an analyst at Hana Financial Investment Corp, said the deal could be a "opportunity for South Korean shipbuilders to overcome setbacks they have faced ... and focus on what they are good at."

QP did not announce breakdown orders for each company.

Samsung Heavy said it expects to sign deals starting this year through 2024 and expected a positive impact on orders by shipping companies who are considering LNG vessels. Both Hyundai Heavy and Daewoo Shipbuilding declined to comment.

($1 = 3.7535 riyals)

(Reporting by Heekyong Yang and Jane Chung in Seoul; Additional reporting by Hyunjoo Jin in Seoul and Jessica Jaganathan in Singapore; Editing by Christopher Cushing and Richard Pullin)