Brazil's suspended President Dilma Rousseff has defended her record during a marathon session during her impeachment trial in the Senate.
She is accused of illegally manipulating the budget to hide a growing deficit.
Ms Rousseff said she was the victim of a political coup d'etat led by those she defeated at the polls in 2014.
Senators are due to vote later this week on whether to reinstate her or remove her from office for good.
"I did not commit the crimes that I am arbitrarily and unjustly accused of," Ms Rousseff said, adding: "We are one step away from a real coup d'etat."
After her opening statement, she was cross-examined by dozens of senators in a session that continued into the night.
One of her fiercest opponents, former presidential candidate Aecio Neves, told her that her electoral victory did not give her the right to break the law.
"From the day after I was elected, several measures were taken to destabilise my government. And you have been systematically making accusations against me," she replied.
Ms Rousseff is accused of moving funds between government budgets, which is illegal under Brazilian law.
Her critics say she was trying to plug deficits in social programmes to boost her chances of being re-elected in October 2014.
During her defence Ms Rousseff reminded senators of her past as an opponent to military rule.
Her fight had been for a more equal society, she said, and the achievements of her government in that field were now "at risk".
She also warned that the interim government of acting President Michel Temer would limit public spending and act in the interest of a small economic elite.
"The future of Brazil is at stake," she said.
Senators from her Workers' Party stood up and applauded once she had finished, while her opponents sat in their seats stony-faced.
For her to be removed from the presidency permanently, 54 of the 81 senators would have to vote for her impeachment.
Brazilian daily Folha de Sao Paulo says it has spoken to all the senators ahead of the vote and that 52 have so far declared themselves in favour of the impeachment.
If Ms Rousseff, 68, is impeached, acting President Michel Temer will serve out her term, which ends in December 2018.
Mr Temer, who was Ms Rousseff's vice-president, assumed the role of acting president in May when Ms Rousseff was suspended from office.
BBC readers' views:
Lucas Catta Preta: Although I personally think that Ms Rousseff has been a bad president, I partially agree when she says a coup is under way because the reasons used in the trial aren't strong enough to remover her.
Juliana Costs: She was by far the most ethical president we ever had. She created two laws to arrest and make corrupted people returned their stolen money. She is a fighter; she has no bank account abroad; she keeps her life style simple. Different from all those dishonest politicians who had been there for decades. It is a very sad for democracy.
Alexander Moskovits: I am a native Brazilian citizen who returned to Brazil after living in the United States for close to 30 years. Dilma is the tip of the iceberg that is presently melting under the fire of unprecedented law enforcement scrutiny in a nation where impunity has always been the norm.
Nicholas Zimmer: However unpopular Dilma might have become, she didn't commit a crime. This is obviously a conspiracy led by multiple interests whose goal is, ultimately, shut the population up. This is a coup. No doubt.