Finding Karina Vetrano’s killer was like searching for “a needle in a haystack,” an NYPD official said a day after a Brooklyn man was charged in the brutal murder of the beautiful Queens jogger.

“This case was very similar to a needle in a haystack because this individual had no prior arrests,” said Chief of Detectives Bob Boyce on Monday, referring to accused killer Chanel Lewis, 20.

During the six-month investigation into the high-profile Aug. 2 killing, investigators poured over 250 leads and 600 samples of DNA until the case finally saw a break last week, Boyce said.

Following up on a 911 call from the spring — and pushed by NYPD Lt. John Russo, whose relatives live near where Vetrano resided with her family — police were able to track down Lewis, who gave a swab of DNA to investigators.

Lewis’s DNA was linked to genetic material found under Vetrano’s fingernails, on her back and on her backpack, authorities have said. He later confessed to strangling the runner, sources said.

Following the press conference, Boyce escorted Mayor de Blasio to meet Lt. Russo backstage.

The mayor shook hands with the cop and congratulated him for his work on cracking the Vetrano case.

At the press conference, Boyce singled out Russo, saying that he “deserves a lot of credit” for the break in the case.

“He followed up on a memory of his when someone was stopped for suspicious behavior,” Boyce said. “We drilled down on that.”

Lewis confessed to detectives that he killed 30-year-old Vetrano after he crossed paths with her on her daily jog along a desolate dirt path nearby her home, sources have said.

Lewis attacked Vetrano inside Spring Creek Park, strangling her, they said.

The East New York resident told investigators he committed the brutal murder simply because he was in a bad mood on his way home, sources said.

Authorities and classmates have added that he had a lot of anger toward women.

During Monday’s press conference, NYPD Commissioner James O’Neill and de Blasio both praised Boyce on the Vetrano investigation.

“This was an extremely tough case to crack when it came to the murder of Ms. Vetrano and you’ve done an amazing job,” said de Blasio addressing Boyce.

The mayor also praised the Howard Beach community who came forward with countless tips on the case.

“That’s what I mean when I say public safety is a shared responsibility,” de Blasio said.