By Anthony Boadle

BRASILIA (Reuters) - A defiant President Dilma Rousseff warned on Monday that her conservative opponents were trampling on Brazil's democracy by using trumped-up charges to oust her and roll back the social advances of 13 years of leftist rule.

Presenting her defense at an impeachment trial in the Senate, Brazil's first female president said the economic elite had sought to destabilize her government since she narrowly won re-election to a second four-year term in 2014.

Rousseff is expected to become the first Brazilian leader in more than 20 years to be dismissed from office on Wednesday when the Senate will rule on charges that she broke budgetary laws by using state banks' money to boost public spending.

In an emotional speech from the Senate podium, Rousseff denied any wrongdoing and compared the trial to her persecution during Brazil's 1964-1985 military dictatorship, when she was a member of a leftist guerrilla group.

She said the impeachment process, which has paralyzed Brazilian politics since December and cast a shadow over last month's Rio Olympics, was little more than a plot to protect the interests of the privileged classes in Latin America's largest economy.

"I did not commit the crimes that I am arbitrarily and unjustly accused of," Rousseff said, in what may be her last public appearance as president. "We are one step away from a real coup d'etat."

If the Senate convicts Rousseff, as expected, her Vice President Michel Temer will be sworn in to serve the rest of her term through 2018.

Temer, who has been interim president since Congress opened impeachment proceedings in mid-May, has vowed to impose austerity measures to plug a growing fiscal deficit that cost Brazil its investment-grade credit rating last year.

Rousseff warned that a future Temer government would dismantle her Workers Party's social programs that helped lift 30 million people out of poverty in the past decade and sell off state assets, including Brazil's massive offshore oil reserves.

In a statement, Temer's office denounced the comments as "false accusations."

Rousseff, a trained economist and daughter of a Bulgarian immigrant, was handpicked by ex-President Luiz Inacio Lula da Silva to succeed him when he stepped aside in 2012, despite her lack of political experience and charisma.

Rousseff, 68, faces no allegations of personal enrichment. But she has been charged on the sidelines of the impeachment process with obstructing an investigation into political kickbacks at state-run oil company Petrobras.

She chaired the board of Petrobras from 2003 to 2010, when the worst of the corruption was taking place. [L2N1850JX]

After riding the commodities boom in her first term, Rousseff's her popularity has dwindled to single figures this year, partly because of the massive Petrobras scandal and partly due to a deep recession that many Brazilians blame on her government's failed interventionist policies.

Unbowed, Rousseff told senators that history would judge them by their votes and recalled her trial under the military dictatorship in 1970, when officers hid their faces to not be recognized in photographs.

"This is the second trial I have suffered in which democracy has sat with me in the dock," she said, choking back tears as she recalled facing death when she was tortured day after day in detention. "Today I only fear the death of democracy."

ODDS AGAINST HER

With many Brazilians assuming the result of the trial to be a foregone conclusion, there were scattered protests by Rousseff supporters on Monday but no sign of the massive demonstrations for and against impeachment that shook Brazil earlier this year.

A survey by O Estado de S.Paulo newspaper said 53 senators have already confirmed they will vote against Rousseff, just one vote short of the two-thirds of the 81 seat Senate needed to dismiss her. Only 19 said they will back her.

"They want to overthrow a president re-elected by 54 million Brazilians and get rid of the Workers Party that has protected the poor," said Thiago Fagundes, a 27-year-old graphic artist and Rousseff supporter in Brasilia. "It looks like they will get their way."

Twenty of Rousseff's former Cabinet ministers were in the Senate gallery to support her, along with Lula himself.

With the odds stacked against her, Rousseff's testimony appeared more aimed at making a point for the history books, rather than a bid to sway a handful of wavering senators.

The impeachment process was launched by the former lower house speaker, Eduardo Cunha, who is facing charges of corruption, including taking bribes in the Petrobras kickback scandal and having millions of dollars hidden away in Swiss bank accounts.

"Curiously, I will be judged for crimes I did not commit before the trial of the former speaker who is accused of very serious illegal acts," she said.

A full one-third of the members of the Senate are under investigation for corruption, graft, fraud or electoral crimes, according to Congresso em Foco, a prominent watchdog in Brasilia.

Temer is confident he has the votes needed to remove Rousseff and plans an address to the nation on Wednesday before heading to China to attend the summit of the G20 group of leading economies, according to his press spokesman Marcio de Freitas.

A strong vote to oust Rousseff would help Temer take the difficult measures needed to restore confidence in Brazil's economy, which is caught in a two-year recession, de Freitas said.

Rousseff is accused of using money owed to state banks to bolster spending during an election year in 2014, a budgetary sleight of hand employed by many elected officials in Brazil. She says the money had no impact on overall deficit levels and was paid back in full the following year.

(Reporting by Anthony Boadle; Editing by Daniel Flynn and Tom Brown)