A family goes to court on a mission to save their dead son’s sperm — and they got it.

Twenty-one-year-old Peter Zhu, a cadet at the US Military Academy West Point, died in a ski accident recently and his parents said his dream was to be a father and raise a family.

Peter’s parents say their son was also the only male child to continue the family lineage — something they attributed that to China’s “one-child” policy.

In order to retrieve his sperm, they had to file a petition and take it to court for approval.

And — a New York Supreme Court judge granted the family’s request.

Peter was an organ donor and his body was kept on life support making it possible for doctors to conduct a sperm retrieval procedure.

It’s now being stored pending a hearing later this month which will outline the next steps.

According to the Army Times, the first documented post-mortem sperm removal was reported in 1980 and the first baby conceived using the procedure was born in 1999.