JOHANNESBURG – In a macabre family feud fought as Nelson Mandela remained in critical condition, a South African court ruled Wednesday that the former president’s grandson must return the bodies of the 94-year-old’s three deceased children to their original burial site.

Mandela is in “perilous” condition and on life support, according to an affidavit filed Friday and made public in the ruling Wednesday, according to a South African newspaper.

The judge’s order means that grandson Mandla Mandela 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.

Mandela, who was imprisoned for 27 years, remained in critical condition in the hospital Wednesday. He was admitted June 8 with a lung infection.

South Africa’s anti-apartheid hero said he wanted to be buried in Qunu and attended the burial of his son at the family plot there 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.

“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.