John Bittrolff is led out of the Fifth Precinct on the way to the First District Court of Central Islip. Photo: Victor Alcorn

A suspected serial killer of three women is finally behind bars two decades after the murders — thanks to what Long Island investigators are calling the “miracle of modern DNA science.”

John Bittrolff, 48, is accused of slaying two prostitutes in the early 1990s and is being eyed in the death of a third woman, Suffolk County prosecutors said Tuesday.

The major break in the cold case came only when Bittrolff’s brother, Timothy, was arrested last summer for violating a protective ­order and cops entered his DNA into a state database.

Timothy Bittrolff’s DNA was a close — though imprecise — match to DNA recovered from the murders, leading cops to John Bittrolff’s door.

“Forensic scientists from the Suffolk County Crime Lab learned that the male who provided this DNA sample was not the killer, but that a blood relative of his was the killer,” said Suffolk County DA Thomas Spota.

“We were able to confirm that the killer had to be a brother with the same parents of the person who ­provided the sample.”

When John Bittrolff, a carpenter and father of two, was hauled in for questioning, investigators retrieved his DNA from a cup of water he had sipped, confirming it was an exact match to the crime scene.

He was brought before a judge Tuesday and charged with killing Rita Tangredi, 31, who was discovered dead on the side of an East Patchogue road in November 1993, and Colleen McNamee, 20, who was found around three months later in the town of Shirley.

BittrolffPhoto: Victor Alcorn

Both women were working as prostitutes and had been sexually assaulted, strangled and beaten before being dumped and “uniquely posed” in a similar manner, leading police to believe the murders were connected, authorities said.

John Bittrolff is suspected of also killing Sandra Costilla, 28, whose remains were found in a wooded area of North Sea, LI, in ­November 1993.

He is not implicated in the murders of some dozen prostitutes whose bodies were recovered along Gilgo Beach in Nassau County since 2010, officials said.

“There is no evidentiary or investigative link between these two murders and any of the Gilgo victims,” the DA said. “The evidence recovered from Tangredi and McNamee, the manner in which their bodies were found and the crime scenes are unique to them and distinctly different from the Gilgo crime scenes he said.

“Justice has finally been done,” said Colleen’s 77-year-old dad, Lawrence McNamee, after learning of the arrest.“I’m just looking forward to whatever max penalty can be given.”

“We’ve been praying for this day for 20 years, so its a relief,” the dad said.