A man carrying a concealed pistol in his sock accidentally shot himself in the foot and injured a woman during a graduation ceremony in Kansas Sunday.

The 37-year-old man, whose name was not released, brought a "small automatic handgun" into Augusta High School's Hillier Stadium, the Wichita Eagle reported.

"It was in his sock," Augusta Director of Public Safety Tyler Brewer told reporters Sunday. "It was being uncomfortable for him. He went to adjust his sock. The weapon went off (and) struck him in the foot."

The bullet ricocheted and struck a woman sitting under a media box about 50 feet away, Brewer said.

Both of the injured people were taken to a local hospital with injuries that didn't appear to be life-threatening.

Brewer characterized the accidental shooting as a "knucklehead situation," The Associated Press reported. It is illegal to carry a gun on school grounds.

Brewer told the AP he expected to present the case to prosecutors to determine whether any charges would be filed against the man.

The commencement went on as scheduled.