Sir David has worked for 35 years in the NHS, including seven years as NHS chief executive. He will retire as chief executive of NHS England in March 2014 after two years in the role.
He has previously faced calls for his resignation following the Francis report into failings at Mid Staffordshire NHS Trust, but received backing from the prime minister.
His retirement was revealed in an exchange of letters, published by NHS England, between the chief executive and the chairman Professor Malcolm Grant.
Sir David said he had agreed to lead NHS England to provide stability for the NHS through the reforms, and that now the new ways of working are taking shape, he would retire next March.
He added: 'Whilst I believe we have made significant progress together under my leadership, recent events continue to show that on occasion the NHS can still sometimes fail patients, their families and carers.
‘This continues to be a matter of profound regret to me but please know that on a daily basis I continue, and will always continue, to be inspired and moved by the passion that those who work in the NHS continue to show’, he said.
He added: ‘I take some confidence from the genuine efforts our staff are making to understand and learn from the complex issues that Robert Francis exposed in his recent report.’
Professor Grant said he was ‘sorry but not surprised’ by Sir David’s resignation, and described his career in the NHS as 'exceptional'.
In a statement, health secretary Jeremy Hunt said: ‘Under Sir David Nicholson’s leadership, NHS waiting times have fallen, infection rates reduced, and mixed sex accommodation is at an all-time low.
'His job has often been incredibly complex and very difficult, and yet he has always had a reputation for staying calm, and maintaining a relentless focus on what makes a difference on the NHS frontline. I am also grateful to him for overseeing the successful setting up of NHS England and giving us an orderly period in which to select his successor.’
During the fall out of the Francis report in February a GP survey found that 89% of our readers supported calls for Sir David to go.
GP and Conservative member of the House of Commons health committee, Dr Sarah Wollaston, called for Sir David to resign at the time of the Francis report.
She told GP: 'It is right for Sir David to step down from his post following this period of transition. I continue to feel that it would have been better for this announcement to have come in response to the Francis Report but the most important issue now is the future leadership of the NHS. I hope that the next chief executive will have both clinical and managerial experience.'