A new book detailing Nelson Mandela’s last days has been withdrawn after it was condemned by his widow, the publisher Penguin Random House has announced.

The book by Mandela’s physician, Vejay Ramlakan, was released last week to coincide with the late South African anti-apartheid leader’s birthday, 18 July, which is marked each year as Mandela Day.

It revealed several undignified episodes at the end of Mandela’s life as well as bitter family squabbles over his care and legacy, prompting fury from his widow, Graça Machel, who threatened legal action.

On Monday Penguin Random House said it had decided to immediately withdraw the book, Mandela’s Last Years, from the trade. No further copies will be issued.

It added that the book “was meant to portray Nelson Mandela’s courage and strength until the very end of his life, and was in no way intended to be disrespectful”.

Machel accused Ramlakan, a former military surgeon, of breaching patient confidentiality.

The book disclosed that after Mandela’s death at the age of 95, a spy camera was found in the morgue where his body was held.

It also revealed that an ambulance transporting Mandela to hospital during his final months caught fire on the highway, forcing him to wait for a backup.

His eldest grandson, Mandla Mandela, also criticised the book.

Machel said she had not been consulted, though Ramlakan claimed that the book had been approved.

“We received permission from the family,” the author told local television eNCA before the withdrawal. “All parties who needed to be consulted were consulted.”

“The story of Madiba’s [Mandela’s clan name] last years is actually, in a sense, more impressive than when he was a fit human being,” he added, paying tribute to his “unconquerable fortitude”.

Penguin Random House did not say how many copies of the book had already been sold.

Mandela married Machel, his third wife and the widow of Mozambique president Samora Machel, in 1998.