PHOENIX – An 18-year-old man was arrested Sunday after a gun he was allegedly carrying in his pocket went off in a West Valley Walmart, authorities said Monday.

Maurice Eugene Weaver Jr. was booked on five charges, including felony counts of discharging a firearm within city limits, disorderly conduct involving a weapon and endangerment, according to a Buckeye Police Department press release.

The two other charges, carrying a concealed weapon while younger than 21 and criminal damage, are misdemeanors.

According to the release, police responded to a call about a gunshot inside the store at Watson and Yuma roads around 5:30 p.m. Sunday.

At 5:19pm @BuckeyeAZP responded to a possible shooting inside of Buckeye Walmart. One shell casing was found in an isle. 3 subjects were detained believed to be involved. It appears this was an accidental discharge of a firearm. There are no injuries from this incident. — Buckeye Police Dept (@BuckeyeAZPD) September 9, 2019

Officers found a bullet impact in the floor, bullet fragments and a shell casing.

Store security footage showed two people leaving the aisle where the gun went off and then the store.

Officers found the subjects and a third person in a car in the parking lot.

Weaver was one of the people, and his pants were torn near the front right pocket.

Police also found a .45 handgun and ammunition in the car that matched the shell casing found inside.

When questioned, Weaver said the gun went off in his pocket while he was in the store, according to police.

The other two subjects weren’t charged, and nobody was injured.

Last week, Walmart said it would introduce new gun restrictions, including asking customers not to openly carry firearms in stores.

In the wake of last month’s deadly mass shooting at a Walmart in El Paso, Texas, and other similar incidents across the U.S., the retail giant also said it would stop selling ammunition for handguns and short-barrel rifles.

Follow @KTAR923