DNA test results have exonerated a man who has been jailed for nearly two months on charges that he grabbed a teenager off a Minneapolis street at gunpoint and raped her twice in alleys several blocks apart.

Now authorities say they have the right man, convicted sex offender Harold T. Davis, 34, of Minneapolis, and they have charged him with first-degree rape and other felonies in connection with the late-night attacks of the same 15-year-old on Nov. 2 in two north Minneapolis alleys.

Police initially arrested Charles E. Stevenson, 34, on Nov. 9 at his home in Minnetonka, and he was charged in Hennepin County District Court. The arrest was based on the girl identifying Stevenson as her attacker from among photos of known sex offenders that were compiled by police for the victim to review.

Investigators say she pointed to Stevenson and “immediately began shaking and burst into tears,” the criminal complaint against Stevenson read.

The prosecutorial about-face is based on DNA test results coming back implicating Davis, said Chuck Laszewski, spokesman for the county attorney’s office.

“We dismissed those charges two days ago” against Stevenson, Laszewski said. However, the spokesman added, Stevenson remains in jail on accusations of failing to register as a predatory offender in connection with an earlier sex crime. Stevenson has on his record a 2003 rape conviction in an attack of a 15-year-old girl and another conviction in 2009 for aiding and abetting prostitution.

In a statement, Hennepin County Attorney Mike Freeman said the evidence initially pointed toward Stevenson.

“When the case against Mr. Stevenson was brought to us, it looked like we had good admissible evidence and therefore we charged him with both first-degree criminal sexual conduct and failure to register as a predatory offender.” Freeman said. “However, when new evidence came in that pointed to Mr. Davis as the likely defendant in this case, we charged him and had the courage to dismiss the criminal sexual conduct case against Mr. Stevenson on Monday in the interest of justice.”

He reiterated that the failure to register as a predatory offender charge stands.

Stevenson’s public defender, William “Butch” Selman, described the charges against his client as “a classic case of misidentification, which we think is a problem.” He added that he was “confident from day one” that Stevenson didn’t do it.

“He always maintained his innocence.” Selman said, adding that he gave the good news to Stevenson. The reaction was relief, he said.

Davis was convicted in 2008 in Hennepin County of second-degree criminal sexual conduct. He was sentenced to a 7 1/2-year term and was under intensive supervised release at the time of the alleged attacks.

While authorities got the wrong man, the details about the attack on the girl remain unchanged as spelled out in the criminal complaint filed Tuesday against Davis:

The teen said she was walking to a friend’s house about 1:15 a.m. and noticed a man she didn’t know was following her. Moments later, he grabbed her and pressed the gun’s barrel to her head.

He took her to an alley near 29th and Irving avenues, and forced her to have intercourse and give him oral sex. Davis then walked her to an alley roughly three-fourths of a mile to the west and raped her in the same manner.

Before leaving the girl, Davis threatened that he knew where she lived and other details about her, and that he had been following her for a while. The girl was taken to a hospital and underwent a sexual assault examination.