Peter Zhu’s mother and father succeeded in a last-minute effort to preserve what they said is “some piece of our child that might live on.”

The 21-year-old U.S. Military Academy cadet was declared brain dead on Wednesday just four days after suffering a fatal injury to his spine in a skiing accident. The fractured spine was unable to adequately deliver oxygen to Zhu’s brain. “That afternoon, our entire world collapsed around us,” Monica and Yongmin Zhu of Concord, California, reportedly said in a court petition.

Zhu’s parents told the court that the young man had often spoken of wanting to be a father and hoped to grant that wish in his memory. On Friday, they petitioned a judge to grant them the right to retrieve their son’s sperm before his organs were removed for donation.

“We are desperate to have a small piece of Peter that might live on and continue to spread the joy and happiness that Peter bought to all of our lives,” they said in a Westchester County court filing. Further, they explained that since Peter was their only son, “it will be impossible to carry on our family’s lineage, and our family name will die.”

The judge granted their request. “As you would expect, it is a very bittersweet result for the family and, out of respect for their privacy, we cannot discuss further at this time,” attorney Joe Williams told NBC News in an email. Zhu will be honored with a memorial at West Point on Tuesday, followed by a funeral at the West Point Cemetery on Thursday.

“Peter was one of the top cadets in the Class of 2019, very well-known and a friend to all,” Brig. Gen. Steve Gilland, commandant of cadets, said in a public release issued on Friday. “He embodied the ideals of the Corps of Cadets and its motto of Duty, Honor, Country and all who knew Peter will miss him.”