Peter Zhu, a West Point cadet who died last week, always wanted to be a father, his parents said. His dream was to live on a ranch, where he would have horses and raise five children, never mind his parents’ jokes about how much all of that would cost.

Now, thanks to a court order, his parents can hope that some part of that dream may still come true.

Mr. Zhu, 21, was found lying in the snow on a ski slope at the United States Military Academy at West Point on Feb. 23 after an accident left him with a severely fractured spine. He was taken to Westchester Medical Center, where he was declared brain-dead on Feb. 27. But because he was an organ donor, his body was kept alive until March 1.

In the two days between the death of his brain and the death of his body, Mr. Zhu’s grief-stricken parents — desperate to hold on to a piece of him and determined to pass their family name to the next generation — petitioned a state court to allow them to retrieve his sperm before his organs were removed.