Portugal's Finance Minister Vitor Gaspar has resigned, the president's office has announced.
The minister has been praised by international creditors for keeping a tight rein on Portuguese finances following the country's 2011 bailout.
However, the country is still in recession with high unemployment, and recent figures showed the budget deficit widening in the first quarter.
The president's office said Maria Luis Albuquerque would replace Mr Gaspar.
In a resignation letter seen by the Reuters news agency, Mr Gaspar said the failure to hit public deficit and debt targets had undermined his credibility.
He also pointed to falling public support for austerity. In March this year hundreds of thousands of people protested against punishing belt-tightening measures.
Some of Mr Gaspar's measures have also been thrown out by the country's constitutional court, leaving the government scrambling to fill the gap in its finances.
He said that also played a part in his decision to go.
Mr Gaspar said he hoped that his resignation would reinforce the coalition government's cohesion at a time of "enormous risks and challenges".
Portugal has been in recession for two years and the economy is expected to contract by 2.3% this year.
The nation received a bailout worth more than 78bn euros ($102bn; £67bn) in May 2011. In return Portugal put in place a tough austerity programme.
Those cutbacks have undermined the economy and helped push unemployment up to more than 18%.
The dire situation has also prompted unions to organise four days of national strikes over the last two years.
The Portuguese government says it is on track to emerge from the bailout programme in June 2014.
But the European Union recently warned that Portugal's economy is likely to contract much more than forecast, raising doubts over whether the government can manage its finances without backing from its European partners and the International Monetary Fund.