Portugal, which received an international bailout last year, became on Friday the second EU country to ratify a European Union pact tightening budget discipline after Greece.
The country's parliament approved the pact, the bloc's main rampart against debt crises, by 204 votes to 24, with two abstentions.
The assembly also approved as expected the European Stability Mechanism, a firewall fund and the second new line of defence against debt contagion.
Portuguese Prime Minister Pedro Passos Coelho, whose centre-right coalition government has a majority in parliament, argued strongly in favour of the pact, saying it "represents our refusal to repeat the errors of the past."
The main opposition Socialist Party said it voted in favour so as not to undermine the credibility of the country even though, like left-wing parties across Europe it faults the pact for not giving enough attention to growth and job creation.
"It is in the name of the option for Europe chosen by Portugal that we shall vote in favour," the party's leader Antonio Jose Seguro said before the vote.
Greece, which also received a bailout, was the first EU country to ratify the pact at the end of March.
The pact, which tightens rules on control of public finances, was signed in Brussels on March 2 by 25 of the EU countries after tortuous negotiations, but it was not signed by Britain and the Czech Republic.
It will begin to be applied once it has been ratified by 12 countries.
Ireland has signed the pact but is putting it for approval by referendum.
In Germany, the biggest eurozone economy, the opposition Social Democrats want the pact to include more measures to encourage growth.
The country may ratify the pact only at the end of the year even although the government has said it would like to see approval at the end of May.
In France ratification of the pact depends on the outcome of upcoming presidential elections.
French Socialist presidential frontrunner Francois Hollande has said he would like to renegotiate the pact to include more steps to boost economic growth.
Under the rules of the pact, almost automatic sanctions will be applied against countries which allow their annual budget deficits to breach agreed limits.
The pact lays down a maximum structural deficit of 0.5 percent of gross domestic product, a maximum public deficit (including cyclical factors) of 3.0 percent of output, and a ceiling for debt of 60 percent of output.
While Portugal is the second EU country to ratify the new rules, it is also one of the 17 eurozone countries having the greatest difficulty in meeting the targets.
The country's ratio of debt to gross domestic product (GDP) is expected to hit 115 percent at the end of the year from around 110 percent currently and then gradually decline. Debt was 93.3 percent of GDP in 2010.
Portugal is one of three eurozone countries to be rescued by the EU and the International Monetary Fund as alarm over the state of public finances pushed up borrowing rates on bond markets to unsustainable levels.
The Portuguese government is cutting spending and raising taxes to meet the terms of its 78 billion-euro ($104 billion) aid plan.
The measures have allowed the government to slash Portugal's budget deficit to 4.2 percent of output last year, less than half of the 9.8 percent reported for 2010.
But the austerity has plunged the country into a deep recession. The Portuguese economy is expected to contract by over 3.0 percent this year while the jobless rate will surpass 14 percent.