The widow of slain NYPD Det. First Grade Wenjian Liu gave birth early Tuesday in Manhattan to a baby girl conceived from sperm retrieved in the hours after he was fatally shot almost three years ago, the NYPD said.

Pei Xia Chen delivered baby Angelina, called “Angel” for short, early Tuesday at New York-Presbyterian Weill Cornell Medical Center Hospital on the Upper East Side, the NYPD said.

Liu, 32, and his partner, Rafael Ramos, 40, were assassinated as they sat in a police car in Brooklyn on Dec. 20, 2014. Both were shot by Ismaaiyl Abdullah Brinsley, 28, a Baltimore man who later committed suicide in a nearby subway station.

“The past three years have been the most difficult,” said Liu’s mother, Xiu Yan Li, now a doting grandmother, as she spoke at her Brooklyn home Tuesday night. “This is the best news we’ve gotten. It feels like my son came back today. This is like God gave us a gift.”

Liu’s pregnancy had been top secret, with even the fallen cop’s parents kept in the dark until the baby was born.

“She didn’t want to break her family’s hearts if it wasn’t successful,” said Susan Zhuang, 31, a family friend, adding that she jumped for joy when she heard the news while at work as chief of staff for state Assemb. William Colton (D-Brooklyn).

advertisement | advertise on newsday

Li said she was making a pot of sticky rice when her phone rang at about 10 a.m. Her daughter-in-law was calling to telling her she had a granddaughter.

“There were gray clouds,” Li said of life since her son died. “And now the sun has finally come out.”

Soon after the phone call, NYPD vehicles arrived at Li’s W. Sixth Street home, just as they did when Liu was killed. Except this time they were taking Li and her husband, Wei Tang Liu, to the hospital to live out a dream they thought died with their son — meeting little Angelina for the first time.

At the hospital, both got to hold their new granddaughter, who weighed in at just under seven pounds.

“It was like I was holding my own son,” Li said.

Liu and his wife had only been married about three months and had plans to have children when he was killed, the NYPD said on its website. While the mortally wounded Liu was on life support, the NYPD said, Chen “requested that her husband’s semen be preserved” in a quest to one day have his child.

An NYPD official said that Liu’s family had wanted word of the birth of Angelina to first be revealed in an internal department message to the rank and file of the NYPD.

But news quickly spread based on information from members of an NYPD widows’ organization, the police official said. And the New York Post reported the story Tuesday afternoon on its website.

Chen, smiling while holding her newborn in photos distributed by the NYPD, predicted she was having a daughter from the beginning, according to an NYPD statement.

“I got pregnant through the [in-vitro fertilization] procedure and I told my friend, ‘It’s going to be a baby girl.’ My friend said, ‘No, you haven’t even checked the sonograms,’ but I was right!”

advertisement | advertise on newsday

Back at home Tuesday night, Liu’s father, mostly sad and withdrawn since his son’s killing, took calls from wellwishers.

Li beamed as a mound of roses and flower bouquets sat on a entry table. She fielded congratulations, including from an old friend from her native China who she spoke with on FaceTime.

“Take care of your new daughter!” the friend said, prompting Li to laugh.

The overjoyed grandmother said the family plans to take Angelina to Liu’s grave when she’s a month old.

“This way I can tell him he has a daughter.”

advertisement | advertise on newsday

With Nicole Fuller