Brazil's president Luiz Inacio Lula da Silva has won a major legislative victory after the Senate approved controversial pension system reforms.
The victory comes at the end of Lula's first term in office
The reforms - which sparked massive protests earlier this year - include raising the age of retirement, and limiting civil servants' pensions.
The government hopes to reduce the huge deficit in Brazil's pension system.
It was thought to be one of the hardest challenges facing Lula, as he is known, when he took office last year.
Brazil's Senate voted by 51-24 to give final approval to proposals to raise the retirement age to 60 for men and 55 for women, phased in over seven years.
Civil service pensions will also be capped and subject to taxes.
The aim is to bring pensions for government workers into line with those in the private sector, and reduce a system which last year cost 4.3% of gross domestic product, or 56bn reais ($19bn; £12bn).
"This is an extremely important day for Brazil," said Senator Renan Calheiros of the centrist Brazilian Democratic Party, a government ally.
Reforming the system was first discussed in the early 1990s.
Lula, on taking office last January, pledged to get approval for the reforms by the end of his first year in office.
Brazil's first working class president directed his Workers' Party to embrace the changes after opposing it for years in opposition.
"Either we do the pension reform now, or in five to 10 years there won't be money for people to retire," Lula said earlier this year.
The government says the reforms will save 50bn reais (US$17bn; £12bn) over the next two decades.
Government workers went on strike in the summer to protest against the reforms.
Some on the left of the Worker's Party felt the reforms would be a sell-out to financial markets.
But there has been popular support for the president's determined effort to bring reforms to a country where many of the 180 million population live in poverty.
Lula's next task is to win approval for reforms to the tax system.