An Aurora police officer was justified in shooting a man earlier this year after responding to a drug deal gone bad, the Kane County state’s attorney’s office said Friday.

Giovanni A. Padilla, 26, was shot in the arm by the officer on Oct. 22 after Padilla allegedly raised a gun at the officer in a shooting stance, the state’s attorney’s office said. The officer fired his gun four times.

The investigation of the shooting was conducted by Aurora police and then sent to the state’s attorney’s office for review.

“After applying the relevant laws to the facts discerned in those materials, State’s Attorney Joseph H. McMahon determined that the use of deadly force was legally justified,” the state’s attorney’s office said in a statement.

Giovanni Anthony Padilla | Kane County sheriff’s office

The incident began about 5:50 p.m. when Padilla, Michael Paige, 18, and Tyrone Smith, 18, went to an apartment in the 1100 block of North Farnsworth Avenue in Aurora to buy drugs, according to the Kane County sheriff’s office and a statement from Aurora police. Once inside, they pulled out guns and took the drugs from the people in the apartment.

They left the building and police were called, authorities said. Officers responded to the northwest corner of Indian Trail and Farnsworth, leading to a short chase that ended in an “armed confrontation” between Padilla and an officer at 5:56 p.m.

The officer found Padilla in a parking lot in the 1900 bock of East Indian Trail and heard him drop something and then kick it under a car, the state’s attorney’s office said. The officer thought it was a gun, and then saw Padilla go to the front of the car and pick it up.

“Padilla stood again and the officer could see that Padilla had a gun in his hand,” the state’s attorney’s office said. “Padilla again began to run. The officer then saw Padilla raise the gun, get into a shooting stance and point the gun at him. The officer, believing his life was in danger, drew his gun and fired four times.”

Padilla was treated at a hospital and then arrested shortly after, police said at the time.

Officers found a loaded .380-caliber semiautomatic Jennings near Padilla, prosecutors said. A bag of pills were also recovered.

Padilla, who lives in Aurora, was charged with armed robbery, armed violence, marijuana possession and five counts of unlawful use of a weapon, police said at the time.

Paige and Smith were also arrested, and another gun and more drugs were seized, police said. Paige, who lives in Montgomery, and Smith, who lives in the Far South Side Fernwood neighborhood, were each charged with armed robbery, armed violence, possession of a controlled substance and two counts of aggravated unlawful use of a weapon, police said.

The report does not mention if the shooting was recorded in any way.

Michael Carnell Paige | Kane County sheriff’s office

Tyrone Timothy Smith | Kane County sheriff’s office