BRASÍLIA—Dilma Rousseff, a former leftist guerrilla who defied a dictatorship but struggled as Brazil’s president, was removed from office Wednesday following an impeachment trial she condemned as a coup.

Far from ending Brazil’s monthslong political crisis, her ouster leaves the country’s new leaders facing the same tattered economy and angry, divided electorate that bedeviled Ms. Rousseff.

Brazil’s Senate voted 61-20 to convict Ms. Rousseff on charges that she used illegal bookkeeping maneuvers to hide a growing budget deficit, deemed an impeachable crime in a nation with a history of hyperinflation and fiscal mismanagement. Two-thirds of Brazil’s 81 senators, or 54 votes, were needed to remove Ms. Rousseff from power.

The outcome was widely expected, though only partly because of the legal evidence marshaled against her. Well before the trial’s final phase opened last week, Ms. Rousseff’s administration had come under pressure over a brutal recession and a massive corruption scandal at the state oil company that splintered her political base and devastated her popular support. Her departure marks a humiliating end for Brazil’s first female president, and closes 13 years of rule by her leftist Workers’ Party, or PT.

Interim President Michel Temer, who served as vice president and was among the many former allies to abandon Ms. Rousseff, will finish out her second term, which runs through the end of 2018.