A man was injured when a gun went off in his pocket while he ran from a traffic stop Sunday in East Garfield Park on the West Side, police said.

The 25-year-old was riding in a vehicle that was pulled over for a “minor traffic violation” at 1:07 a.m. in the 3400 block of West Monroe Street, according to Chicago police.

He got out of the car, started to run and put a handgun in his pocket, police said. The gun discharged as he ran, grazing him in the groin.

The man went to Mount Sinai Hospital on his own and was listed in good condition, police said. No charges were filed against him.

Area North detectives are investigating.