A South African court has ordered Nelson Mandela’s grandson to return the bodies of the former South African president’s three deceased children to their original burial site where the anti-apartheid leader has said he wishes to be buried.

The family feud over the bodies between the grandson, Mandla Mandela, and a coterie of other family members led by his eldest daughter, Makaziwe Mandela, has riveted the attention of South Africans as Mandela, 94, remains in critical condition in a Pretoria hospital, where he was admitted June 8 with a lung infection, and is now clinging to life.

The judge’s order means grandson Mandla must reverse the action he took in 2011, when he moved the bodies from Mandela’s hometown in Qunu to his birthplace of Mvezo, about 15 miles away. Mandla Mandela has authority in Mvezo as a tribal chief and has plans to create a Mandela shrine, hotel and soccer stadium there.

The case has sparked a wide discussion here about family relations and inheritance.

South Africa’s anti-apartheid hero, who was imprisoned for 27 years, attended the burial of his son at the Qunu family plot in 2005.

“It’s an issue of greed, and everyone needs to be quite clear about that,” said Charlene Smith, the author of three books on the former president, including “Mandela: In Celebration of a Great Life.”

“Although he’s been able to bring reconciliation to South Africa, he has this warring family,” Smith said of Mandela. “He hasn’t been able to bring peace at home.”

The family divisions became public this week when 15 Mandela members, including wife Graca Machel, pressed a court case to order Mandla Mandela to return the bodies to Qunu. The judge ordered the bodies to be reburied Wednesday afternoon, and a hearse entered the Mvezo compound shortly after the verdict.

The Mail and Guardian newspaper obtained the affidavit that said Mandela’s health is “perilous” and that a life support machine is helping him breathe.

The court filing said the family members want to bury Mandela in earth “in which his descendant’s remains lie.”

The affidavit filed by daughter Makaziwe Mandela shows the family believes Mandla Mandela is trying to force the burial of Mandela in Mvezo for financial gain.

Mandla Mandela said in a statement Wednesday that he is not against the repatriation of the bodies and will abide by the court decision. But his legal team contends that the graves cannot be exhumed until an appeal to rescind the order is heard.

The case pitted the Mandela family members against Mandla Mandela, who argued that as the family’s eldest male he is entitled to move the graves. Upping the ante in the feud, a Mandela family member pressed criminal charges Tuesday against Mandla for tampering with a grave.

Mandela had six children — four daughters and two sons — with two wives. Only his three eldest daughters remain alive. Mandla Mandela is the first-born grandson.

The graves are that of Makgatho Mandela, who died in 2005 and is Mandla Mandela’s father; Mandela’s first daughter Makaziwe Mandela, who died as an infant in 1948; and Mandela’s second son Madiba Thembekile Mandela, who died in a car accident in 1969.

“The reason why they had to do this in a rush-rush is because they are definite now that he is going to die. So he does not have to die without his dying wish (burial in Qunu) having been fulfilled,” said Mlawu Tyatyeka, an expert on the Xhosa culture of Mandela’s family.