PHOENIX — A 32-year-old man was released from the hospital Friday after he was shot by a Mesa police officer earlier this week. 

Esteban Caraveo Grageda was charged with one count of aggravated assault on law enforcement and one count of misconduct involving weapons after Wednesday night's shooting, police spokesman Detective Jason Flam said. 

Caraveo Grageda was one of two suspects involved in the shooting near Broadway Road and Country Club Drive, but was the only one injured. 

RELATED: Suspect in officer-involved shooting in Mesa identified

He and 32-year-old Jose Elias Andrade Preciado fled a traffic stop attempted by Mesa police in the area of Seventh Avenue and Broadway Road around 6:30 p.m. 

The car chase eventually ended about 16 miles away, near Broadway and Country Club roads, when the vehicle stopped and the two men jumped out and ran. 

Caraveo Grageda was shot by an officer after, according to police, he pulled a handgun from his waistband and turned toward the officer. 

He was hit multiple times and threw his gun over the handrail along Country Club Drive. He was in critical condition after the shooting. 

Caraveo Grageda told detectives that he ran from police because he was "scared due to being in the country illegally," but did not admit to pointing the gun at the officer. 

He said he grabbed the gun as he exited the car, looked back as he ran and saw the officer chasing him. 

When Caraveo Grageda got close to the railing, he turned to the left, back toward the officer, and threw the gun over the railing. The gun, a loaded .45-caliber handgun, was located shortly after. 

Court documents said Caraveo Grageda was not allowed to possess a gun due to a prior conviction for illegal entry into the United States. 

Caraveo Grageda told detectives of his previous arrest and said he left the apartment because his wife was on probation for human smuggling and he believed she was in jail in Mesa. 

He said he grabbed the gun when he got out of the car because he did not want Andrade Preciado to get in trouble for it. 

PREVIOUSLY: Suspect critically injured in shooting involving Mesa police

Andrade Preciado was arrested Wednesday and charged with one count of unlawful flight from law enforcement.