The last medals have been handed out, the athletes have all gone home and the fireworks at Rio de Janeiro's Maracana stadium are fading into memory. Now Brazil's real drama begins.

Just days after the closing ceremony of the Rio Olympics, Brazilian senators are about to decide whether to permanently remove President Dilma Rousseff from office, the climax of a months-long political battle that has laid bare deep polarization in Latin America's largest nation.

The Aug. 5-21 Summer Games were a welcome distraction for many Brazilians angry over endemic corruption and an emerging economy that has gone from analysts' darling to severe recession amid its worst financial crisis in decades. Street parties erupted when their beloved soccer team beat Germany to win gold, a measure of redemption after being humiliated 7-1 by the Germans in the World Cup semifinal two years ago.

With the Olympic bash over, "we return to the divisions, to the fighting," said Fabiano Angelico, a political consultant based in Sao Paulo.

On Thursday the Senate begins the final phase of the trial of Rousseff, who was suspended in May for allegedly breaking fiscal rules in managing the federal budget. Several days of deliberations, including an address to lawmakers by Rousseff herself, will culminate in a definitive vote expected early next week.

Rousseff's opponents argue that she used sleight of hand budgeting to mask the depth of government deficits and ultimately exacerbated the growing economic crisis, which has led to 10 percent inflation, daily announcements of layoffs and repeated credit downgrades from ratings agencies.

Brazil's first female president denies any wrongdoing, pointing out that previous presidents used similar accounting measures. Rousseff alleges that something more nefarious is at play: a bloodless "coup" by corrupt legislators who want to oust her so they can water down a wide-ranging investigation into billions of dollars in kickbacks at the state oil company, Petrobras.

Much of the alleged graft happened over the 13 years that Rousseff's left-leaning Workers' Party has been in power. Several businessmen and top politicians have been jailed, including some connected to Rousseff's government, and a number of opposition officials are also in investigators' sights.

In fact, the probe has blown the lid on a political culture of corruption that spans the ideological spectrum: About 60 percent of lawmakers in the Senate and lower house are being investigated for various crimes, many related graft and the Petrobras scandal.

Rousseff has never been personally implicated, but her detractors say she must have known what was happening and bears responsibility. She refused to block the investigations even as she paid a steep political price through her impeachment, saying it is a process that Brazil badly needs to go through.

The interim government that stepped in for her has also been stung, with three Cabinet ministers forced to resign right after taking office due to corruption allegations. Acting President Michel Temer, who was Rousseff's vice president and is known as a behind-the-scenes dealmaker, has been fingered for alleged bribery by witnesses who have reached plea deals in the Petrobras case, although he has not been charged with any crime.

The result has been widespread popular disgust and anger at both Rousseff and Temer: A national poll by Datafolha last month found that 62 percent of respondents favored holding new elections rather than keeping either one as president.

Rousseff has promised to hold a referendum on whether to call new elections if she survives the Senate trial. But for that to happen, both she and Temer would have to resign or be removed.

Temer, a 75-year-old career politician from the centrist Brazilian Democratic Movement Party, has shown no indication he would step down. He casts himself as a reluctant savior who just wants to do what's best for a divided country, and denies Rousseff's accusations that he's the ringleader in the push to oust her.

If Rousseff is permanently removed, Temer would serve out the remainder of her term through 2018.

"Michel wants to remain president, but he can't show himself to be trying to do that," Brasilia-based political consultant Alexandre Barros said. "It's a complicated equation for everybody."

In any case, Rousseff's odds of surviving the Senate trial appear slim.

In May, 55 of the body's 81 senators voted to impeach and suspend her — one more than the 54 it would take to kick her out for good. Since then Rousseff has embarked on a campaign to change their minds, hunkering down with supportive senators, tweeting regularly against the "coup," holding rallies around the country and meeting with Brazilian and international media.

Earlier this month, 59 senators voted to move forward with the trial.

___

Peter Prengaman on Twitter: http://twitter.com/peterprengaman

Mauricio Savarese on Twitter: http://twitter.com/MSavarese