After Egypt's new finance minister took office last month, one of his first acts was to downgrade the government's assessment of its finances. Hany Kadry Dimian said this year's budget gap would be about a third bigger than his predecessor estimated.
He was acknowledging what may become the biggest threat to Egypt's economic recovery after years of political turmoil: a rising public debt burden.
Since Islamist President Mohamed Morsi was ousted last July, billions of dollars in aid from allied governments in the Gulf have eased most of Egypt's pressing economic problems. Its currency has stabilised, fuel shortages are less severe and the government has resumed spending on economic development projects.
Investors are celebrating; stocks have rocketed to levels last seen before the 2011 revolution while the yield on Egypt's $1 billion sovereign bond due in 2020 hit 5.33 percent this week, its lowest level since December 2012 and down a whopping 5.8 percentage points since mid-2013.
But Egypt's state finances are still getting worse, and a Reuters analysis suggests they will continue deteriorating into the second half of the decade, at the very least. In that time, the ratio of public debt to gross domestic product may rise above 100 percent, a level viewed as potentially dangerous by many economists.
In the worst case, the debt could become so large that servicing it eats up an ever-increasing share of government spending, creating a vicious circle. At a minimum, the debt could crowd out spending by the private sector, adding to Egypt's political tensions by slowing job creation.
"Egypt is spending more than it can borrow given the low gross domestic product growth rates," said Moustafa Bassiouny, Cairo-based economist at Signet Institute.
"It's about having faith that you can repay... Egypt would have to grow around 5 or 6 percent in the next three years and that's highly unlikely. It hasn't yet reached a dangerous point, but it's on a very dangerous trajectory."
Egypt's state finances were unhealthy even before the revolution; the government ran budget deficits of around 8 percent of GDP in the years before 2011.
The political turmoil has worsened the situation by more than halving the GDP growth rate, hurting tax revenues. With private investment weak because of political and economic risks, the government is having to try to revitalise the economy with state spending packages - further adding to the debt.
Although Gulf aid is keeping Egypt afloat and more is expected in coming months and years, it is adding to the debt, not reducing it. Of $10.7 billion received since last July, $6 billion was lending which will need to be repaid rather than grants of cash or petroleum products.
A simple spreadsheet model of Egypt's public debt, created by Reuters, suggests it will be several years before the ratio of debt to GDP, which was 89.2 percent in the fiscal year to last June, levels off and starts to fall.
Dimian said real GDP would grow about 2.3 percent this fiscal year. If the economy keeps growing at that speed, and other factors such as the budget balance and interest rate paid on the debt stay the same, the debt-to-GDP ratio will rise above 100 percent in the fiscal year to June 2017, the model shows.
Relying entirely on faster economic growth to solve the problem doesn't look feasible. Even if GDP growth jumped next fiscal year to 4.3 percent - Egypt's average since 2000 - and stayed there, the debt-to-GDP ratio would keep rising through the end of this decade, though at a slower rate.
That means state spending growth will have to be slowed and revenue growth accelerated in coming years. But the structure of spending makes cuts very difficult.
Out of 717 billion ($103 billion) Egyptian pounds of projected state spending in the current fiscal year, 25.4 percent is earmarked for interest payments on the debt.
While the government has succeeded over the past nine months in bringing down the average interest rate it pays, by conducting fresh borrowing at longer maturities and borrowing Gulf money at preferential rates, there may be little room for further such savings - at least while debt remains so high.
The average yield on nine-month Treasury bills tumbled from almost 15 percent to around 11 percent in the months after Morsi's ouster, but has stabilised in recent weeks.
About 11 percent of state spending goes towards investment and other non-recurring expenses. With Egypt's infrastructure decrepit and private demand growth weak, reducing this spending or even slowing its growth could sink the economy.
That leaves growth in the public sector wage bill, which accounts for around 20 percent of spending, and food and fuel subsidies, which account for 23 percent, needing to be cut - a process that will involve deep changes to the way the government operates, and will have to be spread over years to avoid a sudden shock to living standards that could bring Egyptian protestors back onto the streets.
"There is a structural problem in the government budget which cannot be solved in a short time frame," said Moheb Malak, economist at Prime Securities in Cairo. "That's why what's needed is structural reform."
The government has been tinkering with reforms, such as a smart card system to monitor consumption at fuel stations and subsidised bakeries. It is not clear that radical action is on the cards. Officials have said they aim to cut energy subsidies by up to 30 percent over five to six years.
During the euro zone crisis, countries such as Greece managed to shrink their primary budget deficits - which exclude interest payments - by several percentage points of GDP a year, but at the cost of recessions which sent unemployment soaring.
Because Egypt would risk political unrest with such painful cuts, much slower reforms are likely. An annual reduction of half a percentage point in the primary deficit, through spending restraint and fresh revenues, may be the most it can manage.
Even with such a reduction, and consistent annual GDP growth of 4.3 percent, Egypt's debt-to-GDP ratio would only stop rising in the fiscal year to June 2017, the model shows.
The country may be able to cope with rising public debt ratios for years partly because under 15 percent of the debt is in foreign currencies, a lower ratio than many emerging markets.
This means servicing the debt is unlikely to prompt any balance of payments crisis. It also reduces the incentive for Egypt to default on its foreign debt because it would gain relatively little by doing so.
By restoring democratic rule, presidential and parliamentary elections expected later this year may give Egypt's next government a mandate to make politically difficult decisions, and thus accelerate budget reforms.
Also, Egypt has powerful backers in Saudi Arabia, the United Arab Emirates and Kuwait; those countries have a strong political interest in preventing an economic collapse in Egypt that could permit a recovery of the Muslim Brotherhood, which the Gulf monarchies view as an arch-enemy.
The three Gulf countries posted a combined budget surplus of more than $150 billion last year, suggesting they could maintain their current level of aid to Egypt indefinitely, or even increase it, if they saw it as a geopolitical priority.
This arrangement would not be comfortable, however. Relying on such aid would increasingly make Egypt an economic satellite of the Gulf, which many Egyptians would not welcome. And any future cooling of ties between Cairo and the Gulf would leave Egypt vulnerable financially.
Meanwhile, by financing its debt primarily with issues of local-currency bonds and Treasury bills, the government would soak up an increasing proportion of funds available for lending by local banks. This could deprive the private sector of capital just as it is supposed to be taking off.
"They're borrowing from banks, crowding out the private sector from obtaining bank loans," Malak said.