An armed man was shot and killed by Lakeland police officers Thursday evening, officials said.

David Cuevas, 42, was shot and killed in front of the Starbucks and Five Guys Burgers and Fries located on Socrum Loop Road, according to Lakeland Police Sgt. Gary Gross.

Gross said Cuevas was suspected in an armed sexual battery and armed kidnapping involving his ex-girlfriend.

The events that led to Cuevas' shooting began in January, when police responded to the Suburban Extended Stay motel on Williamstown Boulevard regarding a disturbance.

Police spoke to Cuevas' ex-girlfriend, who said she had been raped at gunpoint by Cuevas. The woman said she and Cuevas met in Philadelphia and began dating for a year before moving to Lakeland in December 2014. At the end of the month, the woman and Cuevas broke up and he left town.

On Jan. 25, Cuevas returned to Lakeland, and on the following day, met his ex-girlfriend at the hotel room. Police said Cuevas told her he had a gift for her, then pulled out a handgun and a knife and sexually battered the woman.

Police said Cuevas then left the hotel and was suspected to be heading back to Pennsylvania.

Lakeland police obtained a warrant for Cuevas' arrest on charges of armed kidnappnig, armed sexual battery and possession of a firearm by a convicted felon. Police said they were also trying to obtain additional charges for stalking and failure to register as a sex offender.

Cuevas was arrested in Pennsylvania on Jan. 28 and allowed to bond out of jail for $35,000. Lakeland police said they do not know why he was allowed to bond out of jail on those charges.

Cuevas then fled from Pennsylvania, which reactivated the original charges.

On Thursday, Cuevas began texting his ex-girlfriend, who immediately contacted police. Detectives said they sent a text message to Cuevas using the woman's phone and convinced him that he was talking to his ex-girlfriend.

Police said that at one point, he sent a text message saying, "I'll make all the pain go away."

Detectives arranged for Cuevas to meet who he thought was the victim at Lake Gibson Park at about 5:30 p.m. When he arrived, though, detectives pulled into the park, turned on their emergency lights and tried to take him into custody.

Cuevas got out of his car and ran from the park towards Socrum Loop Road.  Police said the detectives ordered him to stop, then saw him reach into his waistband to pull out a gun.

That's when police said the two detectives opened fire on Cuevas, hitting him several times.

Cuevas was pronounced dead at the scene. Detectives said they also noticed what appeared to be a self-inflicted gunshot wound in his leg that they believe happened when he pulled the gun from his waistband.

The Medical Examiner will determine how many times Cuevas was shot during the autopsy, which will be conducted Friday. A determination will also be made about the apparent self-inflicted gunshot wound.

The detectives were not injured. They have been identified as Detective Nicholas Pollice and Detective Michael Lewis. In accordance with department policy, the officers will be placed on administrative leave pending the outcome of an investigation.

The investigation continues.