The veteran journalist, who was the BBC News religion editor, has been seriously unwell with complications related to Covid-19 since last year.
Jonathan Munro, the BBC’s deputy director of news, said in a message to staff: “Martin Bashir has stepped down from his position as the BBC’s religion editor, and is leaving the Corporation.
“He let us know of his decision last month, just before being readmitted to hospital for another surgical procedure on his heart.”
Munro’s message ended: “Although he underwent major surgery toward the end of last year, he is facing some ongoing issues and has decided to focus on his health.
“We wish him a complete and speedy recovery.”
Bashir began working as a journalist in 1986 and made headlines around the world in 1995 for his interview with Diana for Panorama.
Diana’s brother Earl Spencer has alleged Mr Bashir showed him fake financial documents and told untrue stories about the Royal Family to gain access to his late sister.
The BBC has appointed Lord Dyson, a retired judge and former master of the rolls, to lead an investigation to discover what steps the BBC and Mr Bashir took to land the interview.
Former BBC director-general Lord Hall led a 1996 internal BBC investigation into the circumstances surrounding Diana’s appearance, which sent shockwaves through the royal family with her revelations about the state of her marriage.
The BBC has previously said in a statement that during an internal corporation investigation in 1996, Mr Bashir admitted commissioning mocked-up bank documents.
They had been shown to Earl Spencer, but he said they had played no part in securing the princess’s appearance on Panorama.
In March, Scotland Yard said it would not launch a criminal investigation into the interview after a former employee of Earl Spencer made a formal complaint to the force.
A legal representative of Alan Waller, who used to work for Diana’s brother Earl Spencer as head of security, had written to the Met alleging unlawful activity.