A man accused of firing a bullet last week at a West Valley City grocery store that injured himself and three others — including a 3-year-old girl who has cancer — was charged with several felonies and misdemeanors on Monday.

Rufino Joseph Cervantez, 36, said the gun went off when he “nearly dropped” it at 1:47 p.m. on Wednesday, outside Smith’s grocery store at 4065 S. Redwood Road in West Valley.

The firearm used in the shooting, a .22-caliber handgun, was reportedly stolen in January. It and two magazines were taken from a car parked at a Salt Lake County motel.

Cervantez was charged in 3rd District Court with second-degree felony theft by receiving stolen property, class B misdemeanor discharge of a firearm and class B misdemeanor possession or use of a controlled substance. He was previously convicted of a felony, so he was also charged with second-degree felony possession of a dangerous weapon by a restricted person. He is also facing third-degree felony obstructing justice.

After the shot was fired, he fled, and evaded police for a few hours before being found in a nearby apartment, with a gunshot wound in the right leg.

Three people were injured by bullet fragments as they were leaving the store: a 3-year-old girl from Las Vegas who is in Utah for cancer treatment, the child’s mother, and another woman. The mother and daughter were released from the hospital the evening of the shooting.

Cervantez told police he was carrying the gun in his waistband when a man bumped him at the store entrance.

The gun reportedly started to fall, court documents state. When Cervantez tried to catch the weapon, it went off, sending a bullet into his thigh, he told detectives.

Cervantez was heard by police telling medical that he had smoked methamphetamine the morning of the shooting, according to court documents.

Police officers found the gun under a fence near another nearby apartment building. They also found a backpack containing a small bag of marijuana, .22-caliber cartridges and a booking sheet with Cervantez’s name on it.

Cervantez had previously been convicted of multiple felonies in California: bringing a controlled substance into prison, possession of a firearm, prisoner in possession of a weapon.

He is being held at Salt Lake County jail in lieu of $1 million cash-only bail.

An initial court hearing on the new charges is set for Wednesday.

Recent court filings list both West Valley City and San Francisco as home for Cervantez. The new charges list him as a transient.

Utah court records show that Cervantez is currently on probation to the Tooele County Justice Court, where he pleaded guilty in January to class B misdemeanor counts of possession of marijuana, and possession of drug paraphernalia. At the time of his plea, Cervantez was sentenced to one year of probation and a $3,600 fine.

In the marijuana possession case, Cervantez was initially charged in 3rd District Court with third-degree felony drug possession with intent to distribute after he was stopped by police on Interstate 80 last December with two pounds of marijuana in his car.

As a result of plea negotiations, the felony case was dismissed and transferred to the justice court for resolution.

Cervantez also has a $450 warrant for failing to appear in South Jordan Justice Court judge last month in connection with a citation for following too close, an infraction. After Cervantez missed his court date, the city prosecutor charged him with class B misdemeanor failure to appear.

Cervantez also has a 2001 conviction in West Valley City’s justice court for class B misdemeanor carrying a concealed dangerous weapon.