The mayor of London's senior aide Lee Jasper has resigned.
Lee Jasper said he had been placed under 'intolerable' strain
Ken Livingstone's race adviser blamed the "racist nature of a relentless media campaign" for his decision.
Mr Jasper had been at the centre of allegations over the misuse of public funds and was due before the London Assembly on the matter on Wednesday.
A Greater London Authority (GLA) statement paid tribute to Mr Jasper's work and said there was no foundation for the allegations against him.
The resignation comes after the Evening Standard newspaper published claims that Mr Jasper had sent intimate e-mails to a woman involved with organisations which received money from City Hall.
In a letter to the mayor, Mr Jasper said: "It has become clear that a number of matters which are not of first importance in London are being used to distract from the crucial questions in the election campaign.
"The racist nature of a relentless media campaign and the consequent effects on myself and family have placed an intolerable strain on all of us.
"I have decided to put a stop to this by tendering my resignation."
On Wednesday Mr Jasper had been due to face the London Assembly to answer questions about his involvement in community projects which received funding from the mayor's office.
The allegations, made by the Evening Standard, concern money paid by the London Development Agency (LDA), the mayor's business arm, to a number of black organisations.
An internal inquiry in January cleared Mr Jasper of any wrongdoing but he was suspended by the mayor and later resigned from the Trident black gun crime advisory board.
A statement from the newspaper said their investigations had been about "demanding transparency on the spending of public money".
"We have always insisted that the mayor has to be held to account for the actions of Lee Jasper whom he personally appointed, and the way London Development Agency grants have been approved and managed.
"It was never a question of racism."
Paying tribute to Mr Jasper's work, a GLA statement said: "Operation Trident, aimed against black gun crime, has been an outstanding success with the arrest of many dozens of criminals engaged with guns without a single shot being fired.
"The GLA is an exemplary authority achieving national recognition in the country in regard to equality and procurement. Lee Jasper played a leading role in regard to these."
London Assembly Conservative group leader, Richard Barnes, said: "Londoners will draw their own conclusions as to why he resigned and avoided the opportunity to 'clear his name' - something he has been demanding."