When New York City Police Officer Wenjian Liu and his partner were shot and killed in their patrol car in Brooklyn in December 2014, Officer Liu had been married not quite three months. That night, as his family and his fellow officers grieved, his wife asked the hospital to retrieve his sperm, so that someday she might have his child.

On Tuesday, Officer Liu’s widow, Sanny Liu, gave birth to a baby girl at a hospital on the Upper East Side of Manhattan, more than two years after the death of the girl’s father, the police said. The baby has been named Angelina.

With a statement announcing the birth, the New York Police Department posted a photograph of the mother, smiling, and the newborn, asleep, who was wearing not a standard-issue hospital hat, but a N.Y.P.D. knit cap.

Officers who had known Officer Liu and mourned with his family, came to the hospital to share in a joyful occasion.