“A TRULY terrible year,” was the assessment of Pedro Passos Coelho, Portugal’s prime minister, as he tried to brighten the mood at the annual summer “festa” of his centre-right Social Democrat party (PSD) in the Algarve earlier this month. In acknowledging the inescapable fact, he was also confirming the accuracy of his forecast in June 2011 that the country faced two “terrible years” of austerity as it struggled to comply with the terms of its €78 billion ($104 billion) bail-out.

But for the first time since he became prime minister just over two years ago, Mr Passos Coelho also had good news to share with 2,000 party faithful, over a beachside dinner of duck and rice. The latest figures from the National Statistics Institute showed Portugal at last emerging from its deepest recession in over 40 years, surpassing expectations with the strongest second-quarter growth in the European Union after ten quarters of contraction.

After a month in which an internal rift over austerity measures had threatened to bring down the coalition government and derail the bail-out programme, the growth figures could not have come at a better time. They were proof, said Mr Passos Coelho, that austerity was producing results, though he added, “No one should take it for granted that the crisis is over.” It certainly does not feel over to most of the country. The economy may have grown by 1.1% from April to June on a quarterly basis, but it shrank by 2% over the same period last year. Unemployment remains at a near record level of more than 16%.

A 6.3% upturn in exports and an easing in the rate at which investment has been contracting are seen as the main causes of the uptick. Tourism is doing well, particularly in the Algarve, as many north European holidaymakers stay away from trouble spots in north Africa and the Middle East. Yet even discounting such seasonal factors, Portuguese businesses note a few other timid signs of recovery, including a slight rise in car sales and a small drop in unemployment.

Antonio Garcia Pascual of Barclays, a bank, says Portugal’s recovery will be “more L-shaped than V-shaped”, with the winding down of state, company and household debt aggravated by a scarcity of bank credit, hampering growth. He forecasts a third consecutive year of recession this year with the economy shrinking 2.7% before registering barely positive growth of 0.2% in 2014, the year when Lisbon is scheduled to emerge from its three-year rescue programme and resume financing its debt in the capital markets.

Even if the recovery gathers momentum and the two governing parties manage to avoid further splits, few believe Portugal will be able to last the course without more outside help. The main question is whether this will take the form of a precautionary credit line, which the authorities could draw on as necessary, or another bail-out with further tough conditions attached. As long as the government delivers promised reforms, other euro-zone governments will probably continue to support it, possibly providing some form of debt relief without calling for write-downs by private-sector investors.

Mr Passos Coelho warned the party faithful of serious risks ahead, including a lack of EU demand for Portuguese exports and the political difficulties of making further deep cuts in health, education and social-security spending. He also raised the possibility of what could prove to be the next big stumbling-block to planned spending cuts totalling €4.7 billion: a further intervention by the constitutional court. Earlier this year it stopped cuts of up to €1.3 billion on legal grounds.

The lines in another such battle appear to be drawn. President Aníbal Cavaco Silva has opted to send draft legislation on civil service “mobility”, widely considered a euphemism for a process expected to result in extensive lay-offs, to the court for vetting. Opposition parties have attacked Mr Passos Coelho’s mention of “constitutional risks” to planned reform as bringing undue pressure to bear on the court.