A Michigan rapist managed to go undetected for nearly two decades before justice finally caught up with him.

Arthur David Long was sentenced Tuesday to 10 to 20 years in prison, the Michigan Department of Attorney General confirmed. DNA evidence left behind at the crime scene helped seal Long's fate.

Long and another man broke into a Flint, Michigan woman's home in 1998. Long sexually assaulted the woman before the pair took off, officials said.

After the crime, the woman — who has not been named — could only manage to identify Long's accomplice.

DNA evidence found at the scene was entered into a state database but they couldn't find a match. For years, officials cross-checked it against other crimes and "DNA samples obtained from court orders,” the attorney general's office said.

SURGEON WHO APPEARED ON BRAVO, ACCUSED OF DRUGGING, RAPING WOMEN, SEES NEW ACCUSERS STEP FORWARD

It wasn't until years later, in 2015, Long's DNA was tested and a match was made.

At the time of the match, Long was in custody of the state’s department of corrections “following a conviction for criminal sexual conduct – 3rd degree at the time."

He was released on parole in 2016 but his freedom was short-lived. Long was taken into custody for the decades-old crime in February 2017. The Michigan Department of Attorney General charged him with two counts of criminal sexual assault in the 1st degree. Long plead guilty to the charges in August.

ATLANTA MAN GETS LIFE SENTENCE FOR RAPE AFTER VICTIM RECOGNIZES HIM AT TRAIN STATION SIX YEARS LATER

“The conviction and sentencing of Arthur Long prove what I have said many times, justice may have been delayed, but it will not be denied to victims of violent crime or their families,” Michigan Attorney General Bill Schuette said in a statement.

Long will simultaneously serve 10 to 20 years for each offense, according to officials.