Lisbon - Portugal is now the third eurozone country to do a debt-rescue deal with the European Union and IMF, announcing a three-year package worth €78bn.
But the reforms required in return are still under wraps and the package is tied to approval by the opposition which has already precipitated an early election by rejecting cutbacks to fight the debt mountain.
A deadline looms on June 15, six weeks away, when Portugal must redeem old loans of nearly €5bn.
The International Monetary Fund, the European Central Bank and the European Union included the main opposition parties in their consultations leading up to the agreement.
"The government has reached a good agreement that defends Portugal," outgoing Prime Minister Jose Socrates announced on television late on Tuesday after long negotiations with auditors from the EU, ECB and the IMF.
Portugal had fought hard against a rescue, saying it was a different case from previous rescue cases Greece and Ireland.
But it eventually succumbed last month to pressures from financial markets where interest rates for it to borrow had reached unsustainable heights, and from within the EU where there was concern that a debacle for Portugal could drag down Spain.
Socrates signalled that in one sense the conditions of the deal give Portugal some extra breathing space to combat its debt mountain.
He said that the deal worth $116bn "is a three-year programme which sets more gradual deficit reduction targets: 5.9% this year, 4.5% in 2012 and 3% in 2013."
Portugal had previous targets of 4.6% this year, 3% in 2012 and 2% in 2013, but this framework was undermined by official national data last month putting the public deficit last year at 9.1%, far above the target of 7.3%.
Socrates did not reveal the conditions which Portugal has had to accept in return for the emergency funding to ensure it does not default on debt on June 15.
Press reports here suggest that they will probably include deep reforms of labour laws, reducing the length and amount of unemployment benefit, and would also impose increased capital requirements on the banking system.
He said merely that he had to hold "consultations" with opposition parties before announcing the medicine prescribed by the three institutions.
Socrates has his wings clipped because his government was forced to resign and call an early election when the right-wing opposition rejected a fourth round of corrective budget measures.
The IMF said late on Tuesday that the agreement would have to be approved by the main opposition parties.
A spokesperson said: "We have said from the beginning that it is important that any programme should have broad cross-party support and we will continue our engagement with the opposition parties to establish that this is the case."
The public debt amounts to nearly €160.4bn, representing 93% of gross domestic product. The ceiling for eurozone countries is 60%.
Portugal, during its fight to avoid a rescue, announced a series of reforms involving spending cuts and privatisations, but the economy is under great pressure and the central bank here expects it to contract by 1.4% this year.
Meanwhile there is persistent and deep concern on the markets where governments borrow funds, that Greece, which triggered the eurozone debt crisis about 18 months ago and forced the EU into a U-turn to invent rescue funding, might have to restructure its colossal debt.
Top EU officials are increasingly insistent that such a move, which would most probably mean losses for investment funds and banks, is unnecessary and in any case would cause worse problems than it would solve, in part because it would be a new blow to the credibility of the eurozone.
Socrates insisted that Portugal was a different case. "International institutions have recognised that the Portuguese situation is a far cry from those in other countries," he said.