RIO DE JANEIRO — The impeachment fight in Brazil over whether to permanently remove President Dilma Rousseff from office has been about more than the charges that she mismanaged the federal budget. The Associated Press explains how it got to this point and how the trial is playing out:


HOW ROUSSEFF’S SUPPORT COLLAPSED

Rousseff was re-elected to a second four-year term in October 2014. As the economy worsened, hundreds of thousands took to the streets in early 2015, with many demanding the ouster of Rousseff and her left-leaning Workers’ Party. Her foes in Congress introduced a measure last year to impeach and remove her. In April, the Chamber of Deputies approved it 367-137 and in May the Senate voted 55-22 in favor. Rousseff was suspended and Vice President Michel Temer became interim president. The process is culminating in a Senate trial that is to end with a vote Wednesday on whether to remove her permanently.


THE CHARGES: ILLEGALLY MOVING MONEY BETWEEN BUDGETS

Rousseff is accused of illegally shifting funds between government budgets. Opposition parties say that was to boost public spending and shore up support while masking the depths of deficits. Opponents say Rousseff’s budget maneuvers aggravated the crisis in Latin America’s largest economy.


THE DEFENSE: IT’S A COUP!

Appearing before the Senate on Monday, Rousseff repeated her contention that the impeachment effort is a “coup” by corrupt opposition lawmakers meant to derail investigations into billions of dollars in kickbacks at the state oil company. She also said other former presidents used accounting techniques to those she used. Her supporters also argue that Brazil’s ruling class wants to end 13 years of leftist government.


THE STAKES: OUSTER

A supermajority — 54 of the 81 senators — is needed to convict her, which would result in her permanent removal from office. A conviction would permanently remove Rousseff from the presidency and bar her from holding any office for eight years. Temer would serve out her term, which ends Dec. 21, 2018. If convicted, Rousseff would likely appeal to the country’s highest court. But previous appeals during the process have failed.


ANOTHER POSSIBILITY: RETURN TO OFFICE

If fewer than 54 senators vote to remove her, Rousseff would return to office. She has promised that if that happens, she would let voters decide in a plebiscite whether they want early presidential elections.


BRAZIL’S POISONED POLITICS CLOUD THE FUTURE

Brazilians are soured on politicians in general; both Rousseff and Temer are very unpopular. A poll taken last month by Datafolha found that 62 percent want new elections to solve the crisis. But before new elections could occur, both Rousseff and Temer would have to resign or be removed from office.