Parliament in Brazil has voted to start impeachment proceedings against President Dilma Rousseff over charges of manipulating government accounts.
The "yes" camp comfortably won the required two-thirds majority in the vote in the lower house in Brasilia.
The motion will now go to the upper house, the Senate, which is expected to suspend Ms Rousseff next month while it carries out a formal trial.
She denies tampering with the accounts to help secure her re-election in 2014.
Her supporters describe the vote as a "coup against democracy" and the ruling Workers' Party has promised to continue its fight to defend her "in the streets and in the Senate".
But Ms Rousseff is an unpopular leader in a country facing a severe economic crisis, the BBC's Wyre Davis reports from Brazil.
How big was the blow?
Impeachment supporters netted 367 votes in the lower house of Congress, well above the 342 they needed.
The "no" camp took 137 votes, seven deputies abstained and two did not show for the ballot.
Victory celebrations were loud and colourful among the hundreds of thousands of demonstrators who watched the vote live on huge TV screens on city streets across the country.
What comes next?
Early next month, the Senate will vote on whether to put the president on trial.
If the vote passes, she will be suspended and replaced by Vice-President Michel Temer.
A Senate trial could last up to six months. If at the end of it two-thirds of senators were to vote to impeach, Dilma Rousseff would be out of office for good.
Temer as president? Analysis by Daniel Gallas, BBC News, Brazil
Most Brazilians would be forgiven if they saw a picture of Michel Temer and did not recognise him. Yet this 75-year-old law professor may soon be leading a country amid its most serious political and economic crisis in decades - if President Rousseff loses the battle against impeachment.
Mr Temer's most notable achievement as a politician has been to help the country's biggest political party - the PMDB - form coalitions with every president in the past two decades. He is currently party president.
Rather like his party, which has not held outright power for over two decades, Mr Temer has always been a kingmaker, but never king.
What is Rousseff accused of doing?
Brazilian governments are required to meet budget surplus targets set in Congress, which investors regard as a measure of economic health.
Ms Rousseff is accused of allowing creative accounting techniques involving loans from public banks to the treasury, which artificially enhanced the budget surplus.
She argues that she did nothing criminal but her opponents are unforgiving.
"We fought a lot to sack this corrupt government, which destroyed our industry, jobs and left chaos in all social classes," demonstrator Marisa Cardamone, 75, told AFP news agency in Sao Paulo.
Why is she so unpopular?
Today, Dilma Rousseff presents a sorry contrast to her popular predecessor and mentor, Luiz Inacio Lula da Silva, whom she succeeded in 2011.
Critics say she took an arrogant attitude to Congress and her economic policies were misguided, even if she enjoyed some credit as an honest politician in a political world mired by corruption investigations.
Who are the alternatives?
Vice-President Temer could face impeachment himself over the same accusations as those put to Ms Rousseff.
Two other possible successors, lower house Speaker Eduardo Cunha and Renan Calheiros, face corruption allegations.
The three men, who all deny the allegations against them, are from the PMDB - the largest party in the coalition, which abandoned Ms Rousseff to support the impeachment.
"I'm happy because I think Dilma had to go but I'm also sad that it came to this and also really worried that the next president could be even worse,'' Patricia Santos, a 52-year-old small business owner among the demonstrators outside Congress, told AP.
Dangerous days for Brazil?
There is no suggestion that the fight promised by the Workers' Party "in the streets and in the Senate" will be anything but political, though Brazilians are certainly bitterly divided.
Passions are so high on both sides that the authorities erected a makeshift 2m (6.5ft) high metal wall, stretching for 1km (0.6 miles), to keep thousands of rival demonstrators apart outside Congress in Brasilia.
Ms Rousseff and her allies have accused their opponents of mounting a coup. "This fascist congress wants to lead a coup d'etat against Brazil's democracy but they will not succeed," one protester told AP.
The front page of Brazil's right-leaning paper O Globo carries a photo of MPs celebrating under the headline "Close to the End". A headline in the left-leaning online magazine Revista Forum reminds readers the impeachment still has to clear the Senate.
In the hours after the vote (central Brazil is three hours behind GMT), two of the top hash tags on Twitter in Brazil were #AlutaComecou ("the struggle begins"), used by both sides, and #ValeuCunha ("Thank you, Cunha") - addressed to the parliamentary speaker.
There was no immediate comment from the president herself but her chief of staff, Jacques Wagner, accused parliament of "threatening to interrupt 30 years of democracy in the country", which was under military rule until 1985.
Are the Olympics likely to be affected?
Olympics chiefs say preparations for the Games in Rio this August are on track despite Brazil's political and economic troubles.
Are you in Brazil? How has the political crisis affected you? Email us your views to firstname.lastname@example.org.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: