Looks like the smoking finally did him in.

Suspected killer Lee Robert Miller, 54, probably didn't think twice when he tossed a cigarette butt as he went about his business one day in February last year.

But unbeknownst to him, police who had been following him were watching - and saw the opportunity to grab a sample of his DNA.

For more than 20 years, police in Washington state and neighboring Idaho tried to solve two murder cases connected to Miller. But conclusive evidence eluded them.

No one in their databases came up as a match to the DNA samples they put through the system. But the sample from the murders of 57-year-old Marilyn Hickey in Washington in 1992, and of 49-year-old Cheryle Barratt in Idaho in 1994 were a match.

The cigarette butt ended up giving detectives the DNA sample they needed to put a name to the cold cases. Police arrested Miller, who lives in Boise, on Wednesday night. They charged him with first-degree murder for Hickey’s death, and named him a suspect in Barrett’s murder.

Miller is being held in Ada County Jail in Idaho and is expected to be extradited to Washington, according to a statement by Boise Police Department.

“This is a significant achievement for the Boise Police Department and the Bremerton Police Department, as we were able to use advancements in technology and coordinated investigative efforts to make strides in two decades long investigations,” said Boise Police Sgt. Justin Kendall.  “Our detectives have worked for years to make progress on these investigations to help find answers for our community and justice for the victims.”

Police in 1992 found Hickey slain in her studio apartment in the Washington town of Bremerton, according to the Idaho Statesman newspaper. She was found to have been strangled. And the killer left a pair of scissors in her chest. Police concluded she had been stabbed - after she had died from the strangulation. Police also found semen at the scene.

Hickey reportedly had been seen the night before her murder leaving the Drift Inn Tavern with a man resembling Miller, according to published reports.

Meanwhile, in 1994, Barratt was fatally stabbed in her home.

The cases went cold for many years before they were reopened in 2017, the Statesman reported.