Photograph: Pedro Belleza

After a marathon six-hour session last Sunday, the Brazilian lower house of congress voted by more than a two-to-one margin to approve the impeachment proceedings against sitting president Dilma Rousseff of the ruling Workers’ Party. A televised broadcast of the vote emptied the streets like a match of the national soccer team.

The 511 representatives certainly delivered a spectacle. With ten seconds to cast their votes, many invoked God and country or reveled in the national media exposure. One in favor of impeachment dedicated his vote to the generals of the dictatorship, while another who voted against impeachment was shouted at with homophobic slurs.

The vote has come after months of investigations of a wide-ranging corruption scandal: Operaçao Lava Jato (literally, Operation Car Wash) that has implicated politicians from all major parties, major construction companies, and the state-owned oil company, Petrobras. In the wake of the scandal, Rousseff has had to scale back her party’s signature redistributive measures, alienating traditional bases of support from social movements and unions. For several weeks the possibility of impeachment lingered in congress thanks to shifting inter-party alliances, but the recent disembarking of the centrist Brazilian Democratic Movement Party (PMDB) from the government coalition removed the last protective barrier Rousseff’s government had in congress. It now seems that the process will be easily approved in the senate, temporarily removing Rousseff from office before a final judgment sometime in the next month, which would permanently install her vice president, Michel Temer, a member of PMDB.

Unlike many who voted against her, President Rousseff has not been named in corruption investigations.

But if the country emerges from the weekend with some clarity about the impeachment proceedings, its future, and the future of its democracy, is much murkier.

Although many representatives justified impeachment by appealing to popular outrage, Brazilian society is, in fact, deeply divided on the issue. For every demonstration against Rousseff, there has been a counter-demonstration—if not in defense of Rousseff’s government, then of the rule of law and democracy. Much less reported by Brazil’s media, these have taken place in hundreds of cities throughout the country. Many prominent intellectuals, human rights activists, and large sectors of organized civil society view impeachment as a coup and a diversionary tactic. Indeed, unlike many of her critics, Rousseff herself has not been named in the Lava Jato corruption investigations. On the other hand, Eduardo Cunha, the congressman leading the impeachment process and the next in presidential succession after Temer, is under investigation, along with nearly a hundred other representatives who voted for impeachment.

One striking fact about Sunday’s vote is that hardly any representatives mentioned the legal basis of the impeachment claim, so-called “fiscal pedaling” (pedaladas fiscais), a dubious but widely practiced budgeting maneuver in which repayment to government lenders is delayed to give the appearance of greater fiscal health. Many leading legal scholars do not think this meets the Brazilian constitution’s standard of “crime of responsibility” required to open impeachment proceedings—and most agree, in any case, that the vice president is equally liable.

But none of this mattered on Sunday. Opposing representatives wanted Rousseff out; the vote was split precisely along party lines. Surely some were driven by anti-left sentiment; others no doubt were lured by talk of positions in a new administration.

Though the defeat will occasion a fair amount of rethinking for the country’s left, the real loser on Sunday was not Rousseff or her Workers’ Party but the country’s political system. Less than thirty years old, Brazilian democracy is the fruit of a popular struggle, and its constitution is a model of post-authoritarian transition. It has survived a number of tests, and in recent years there has been talk of political reform that might make the system more accessible to the majority. But the impeachment vote leaves the country deeply polarized, setting a terrible precedent that unpopular presidents can be impeached, that laws matter less than popularity, that congress is less a place for debate than for making deals, and that political office can be openly used for individual gain. It is hard to imagine a governable scenario emerging from this process. And without that, it is hard to imagine a bright future for the country’s democracy.