By Natuza Nery and Raymond Colitt
BRASILIA (Reuters) - President Luiz Inacio Lula da Silva's chief of staff resigned on Thursday over an ethics scandal that the opposition is trying to use to derail his candidate in next month's presidential election.
Erenice Guerra, whose role as cabinet chief is an influential post in the Lula government, had been under growing pressure in recent days to step down over allegations that she was involved in a kickback scheme for public works contracts.
Trailing badly in opinion polls, main opposition candidate Jose Serra has sought to link the scandal to ruling party contender Dilma Rousseff, who preceded Guerra as Lula's chief of staff before hitting the campaign trail.
Rousseff remains on course to win a majority of votes in the first round of voting on October 3 and become Brazil's first woman president, despite the allegations that she condoned unethical conduct within her leftist Workers' Party.
She has not been directly linked to any wrongdoing, which analysts say makes it unlikely the scandals will cut her lead.
"The chances that it forces a second round are still rather small. The opposition would have to be very skilled to exploit this incident," said Amaury de Souza, a Rio de Janeiro-based political analyst.
"The corruption scandals so far didn't change voter preference except among those with higher education or income. That is insufficient to change the odds."
Rousseff has 51 percent of voter intention against 27 percent for Serra of the opposition PSDB party, according to a Datafolha poll released on Thursday. The same poll last week showed Rousseff with 50 percent against Serra's 27 percent.
Rousseff has held and even increased her lead despite accusations, fuelled by intense media coverage, that the ruling party illegally accessed tax records of Serra's daughter and opposition members to gather potentially damaging information against them.
The separate scandal involving Guerra, who worked closely with Rousseff when she was cabinet chief, centred on allegations that she helped her son's consulting firm skim money off public works contracts.
Guerra will be replaced on an interim basis by Carlos Eduardo Esteves Lima, an official in the chief of staff's office. A permanent replacement will likely be named next week, a government spokesman said.
Riding the enormous popularity of Lula, Rousseff has been predicted by all major polls in recent weeks to win the majority of votes she needs to win the election outright and avoid a runoff on October 31.
With null and blank poll responses removed -- as happens with ballots in the election -- Rousseff has 57 percent, the Datafolha poll showed.
(Writing by Stuart Grudgings; Editing by Todd Benson and Vicki Allen)