"He (Mandela) is assisted in breathing by a life support machine... the anticipation of his impending death is based on real and substantial grounds," Xinhua quoted from the court document by his family members.
The document was reportedly submitted in the Eastern Cape High Court.
The South African Press Association (SAPA) said that the papers were filed by more than a dozen family members on Friday, so the "perilous" breathing situation has been lasting at least for six days for Mandela.
The former president's health condition has been "critical" since June 23.
Mandela, to turn 95 soon, was admitted to a Pretoria hospital June 8 for a recurring lung infection.