BRASÍLIA — After an all-night debate, Brazil’s Senate voted Thursday morning to suspend President Dilma Rousseff and begin an impeachment trial against her, ousting a deeply unpopular leader whose sagging political fortunes have come to embody widespread public anger over systemic corruption and a battered economy.

In a vote of 55 to 22, lawmakers accepted the charges against Ms. Rousseff, accusing her of borrowing from state banks to conceal a looming deficit, a budgetary sleight of hand that critics say was aimed at securing her re-election two years ago.

“We could no longer ignore these crimes and thus voted for impeachment,” Álvaro Dias, a senator from the Green Party, said shortly before casting his vote. “Having been assaulted by incompetence and wrongdoing, Brazilians expect punishment.”

During her impeachment trial, which could last six months, Ms. Rousseff will be replaced by a onetime ally, Vice President Michel Temer, who has been convicted of violating campaign finance limits and will now be under tremendous pressure to stem Brazil’s worst economic crisis in decades.