Saudi Binladin Group, the kingdom's biggest construction conglomerate, appears to have pulled back from the brink of a financial crisis that risked damaging the wider economy.
SBG was hard hit last year as low oil prices forced the government - its chief customer - to cancel or suspend projects and delay payments. It was then barred from receiving new state contracts altogether after one of its cranes toppled into Mecca's Grand Mosque during a storm, killing 107 people.
Facing a severe cash squeeze, it has been forced to halt work at a string of projects and lay off thousands of staff. Many of its foreign workers in Jeddah, Mecca and Riyadh did not receive their salaries for months. Some staged public protests and in once case, they set company buses on fire.
But the government has taken a more benign approach to SBG in the past three months, letting it resume bidding for new contracts and, according to banking and construction industry sources, making some long-overdue payments to the group.
This has helped the firm pay salaries to some 10,000 workers, secure a 2.5 billion riyal ($667 million) loan from local banks, repay bondholders and resume work at some stalled projects.
An SBG spokesman declined to discuss details of the conglomerate's finances or the status of its projects.
Riyadh has a strong incentive to keep SBG afloat. The group's health matters to the Saudi banking system and wider economy because of its large debt - it is estimated to owe local and foreign banks a total of about $30 billion - and its involvement in many of the kingdom's most important projects.
Continued turmoil at the company could also have a ripple effect on its large network of suppliers.
SBG still faces a challenging future, however.
The group may never regain the preferential access to big projects and control over pricing that it enjoyed for decades, bankers and analysts say - an example of the pressures that Saudi Arabia's family business empires face as cheap oil forces the kingdom to restructure its economy.
"Binladin has enjoyed for a long time a very privileged position that will probably go and never come back," said a senior banker in the region, declining to be named because of commercial sensitivities.
David Butter, a business analyst at the Chatham House think-tank in London, said: "The whole system has gotten a bit sloppy and complacent over the past 10 to 15 years in an environment where there have been no constraints on spending.
"You've had companies able to count on a sweetheart system whereby contracts were allocated among an elite group. Now perhaps there's space for other companies."
The crisis over the past year, and Saudi Arabia's new economic realities, have forced SBG to seek to reduce its reliance on government revenue. It has hired overseas experts and drawn up a new business plan which executives have been presenting in talks with creditors.
Banking sources briefed on the plan say the group will aim for more modest growth and focus more on private-sector leisure projects and overseas business.
SBG benefited for many years from close ties with the government. Mohammed Binladin, a Yemeni immigrant who founded the group in the 1940s, distinguished himself as a dependable partner by building palaces for the kingdom's expanding line-up of princes. SBG became a behemoth with hundreds of subsidiaries.
But as the business grew, the group tolerated cost overruns and poor bookkeeping, confident that it could secure additional financing from its royal patrons, said bankers, employees and construction industry sources.
"Saudi Binladin Group is a family business that ballooned based on relationships," said a construction executive who worked with SBG for over a decade. "As they started to grow in scale, they developed inefficiencies."
That left SBG severely exposed as low oil prices caused the government to cut spending and left it reeling when it was subsequently banned from receiving state contracts.
The cash squeeze over the past year has forced the company to halt work at projects including Jeddah's new King Abdulaziz International Airport and the King Abdullah Financial District in Riyadh.
Work also stopped at Abraj Kudai, a gaudy $3.5 billion, 45-storey luxury hotel in Mecca that is to feature royal floors and rooftop helipads. It slowed for several months at Jeddah Tower, designed to be the world's tallest building.
The cash crunch has now partially eased. The government let SBG resume bidding for new state projects in May and made some delayed payments to the group.
The brighter outlook helped the company secure the 2.5 billion riyal Arab National Bank and Saudi British Bank around the same time, according to banking sources.
SBG resumed work at the Jeddah airport in early June and repaid holders of a 1 billion riyal Islamic bond maturing late that month, albeit after a delay.
The company has hired about 30 finance and management professionals from overseas, including former Morgan Stanley banker Klaus Froehlich as chief financial officer, and drawn up the new business plan.
The SBG spokesman said it had finished laying off and compensating about 70,000 foreign workers, reducing staff numbers from about 200,000 over the past several months - a purge which bankers see as positive.
The group remains under pressure, however. It has asked banks to extend an 817 million riyal loan that matured last week and was being used to fund construction at the Grand Mosque, with government payments for the project still delayed, according to sources familiar with the matter.
Ultimately, bankers' willingness to extend credit may depend on SBG's relations with the government. An economic reform drive launched by authorities last month emphasises cost-cutting and efficient use of state money, which could affect SBG's business.
Big family conglomerates in Saudi Arabia are also under pressure from authorities to invest more in the economy now that oil prices are low. This has become a source of friction between SBG and the government, bankers said.
"All of the major family business groups in this country have done very well under an economic system that is on its way to reform," said the senior banker.
But time will tell whether the government's reforms work, he added. "They're taking on some strong vested interests."
Subscribe to Arabian Business' newsletter to receive the latest breaking news and business stories in Dubai,the UAE and the GCC straight to your inbox.