Brazil's lower house of Congress has voted by a large majority to overhaul the country's generous pension system.
The vote, with 379 in favour and 131 against, is seen as an important victory for President Jair Bolsonaro.
His government says the reforms are critical to boosting the growth of South America's biggest economy.
But the controversial bill requires a second vote in the lower house before moving to the Senate where it faces weeks - or months - of more debate.
The next vote is due to take place before Congress breaks for recess next week.
Proposed reforms include raising the retirement age and increasing workers' contributions. Trade unions and opposition politicians argue that such moves would penalise the poorest, forcing them to work longer.
As lawmakers voted, demonstrations led by trade unions took place across Brazil. In Sao Paulo protesters closed down one of the city's main avenues.
President Bolsonaro took to Twitter after the vote, congratulating lower house Speaker Rodrigo Maia.
"Brazil is ever closer to getting on the path to jobs and prosperity," he said.
What would change?
The government's plan includes raising the minimum retirement age to 65 for men and 62 for women.
Many Brazilians currently retire in their mid-50s.
They are currently required to have contributed to the pension system for 35 years (men) or 30 years (women).
The new proposal would delay a full payout of pensions until 40 years of contributions had been paid in, but partial pensions could be accessed earlier.
The government estimates the plan would result in savings of $266bn (£212bn) over the next decade, and would be phased in over 12 to 14 years.
Wednesday's vote approved only the basic text of the bill. The lower house is due to begin voting on any amendments on Thursday and the bill must then clear a second vote to reach the Senate.
Why is the government pushing this?
Many previous governments in Brazil have tried but failed to reform the country's pensions.
The current system is proving extremely costly, as people are living longer.
Brazil's federal government spends 45% of its budget on pensions, and only 2.8% to build and maintain public schools and hospitals, roads, police, sanitation and other infrastructure, according to the Wall Street Journal, citing the economy ministry.
The country is still struggling to recover from the 2015-2016 recession, which was the worst in more than a century.
If the bill passes, it is expected to have a positive effect on investors' perceptions.
Why is it controversial?
Generous pensions have been enshrined in Brazil constitution since 1988, when a social safety net was developed after decades of military rule.
Opponents say the poor would be the most affected by the proposed changes, as they are more likely to start working at a young age and would be required to work longer before being able to collect pension benefits.
Unions have mobilised mass protests against the reform efforts.
There have also been some smaller counter-protests from people insisting that the reform is necessary.
Why is it key to Bolsonaro?
President Bolsonaro, a far-right politician who was elected last year, has made the issue a priority.
He has been seeking to show he has the negotiation skills to pass the bill - which looked increasingly harder as opposition parties vowed to block it.
Brazilian lawmakers are known to strike hard bargains, often demanding changes in other policies in exchange for their support, says BBC South America correspondent Daniel Gallas.