On what could be her last day as Brazil's president, Dilma Rousseff mounted a forceful defence of her time leading Latin America's most populous nation.
She warned senators that ousting her would hurt a young democracy while defiantly promising to go down fighting in what many see as a losing battle.
Ms Rousseff, who has been suspended since May, delivered a 30-minute address on Monday at her impeachment trial in the Senate, and was then questioned by senators for more than 14 hours.
The Senate was due on Tuesday to begin proceedings for a final vote on whether to remove her permanently.
The impeachment measure was introduced in the lower House of Deputies late last year, splitting the nation.
The turmoil continued during the hearing, as police in Sao Paulo fired tear gas against people demonstrating in support of Ms Rousseff.
Two Brazilian social groups called for protests and gathered in the city's main avenue with signs against Michel Temer, Ms Rousseff's vice president, who has been the acting leader since she was suspended.
Protests erupted in several other cities in support of Ms Rousseff, including in the capital, Brasilia, where senators were questioning her on the fourth day of her impeachment trial.
Opposition senators accused her of breaking fiscal responsibility laws to hide holes in the budget, saying that exacerbated a recession which has led to 10% inflation.
She called that nonsense, contending she broke no laws and noting that previous presidents used similar accounting measures.
She said she was forced to make tough choices on the budget in the face of declining revenues and a refusal by opponents in Congress to work with her.
If anything, she said, the impeachment process had hurt the economy, placing the blame on the opposition, which has argued that she has to be removed for the financial climate to improve.
"I know I will be judged, but my conscience is clear. I did not commit a crime," Ms Rousseff told senators.
For Ms Rousseff to be removed, at least 54 of the 81 senators need to vote in favour.
Counts by local media say 52 senators have said they plan on voting for removal, while 18 are opposed and 11 have not said one way or another. In May, the same body voted 55-22 to impeach and suspend her.
"I need all of you, regardless of political parties," Ms Rousseff said in her closing remarks to senators, urging them to keep her in her job.
She reminded them that she was re-elected in 2014 with more than 54 million votes,.
Ms Rousseff asserted that impeachment was the price she had paid for refusing to quash a wide-ranging police investigation into the state oil company Petrobras.
She said that corrupt politicians conspired to oust her to derail the investigation into billions in bribes at the oil giant.
The investigation has led to the jailing of senior businessmen and politicians, including in her Workers' Party.
Watchdog groups estimate 60% of the 594 politicians in both chambers are being investigated for wrongdoing, many for corruption related to the Petrobras probe.
Ms Rousseff said it was "an irony of history" that she would be judged for crimes she did not commit, by people who were accused of serious offences.