MODESTO, Calif. -- A Modesto pastor is recovering after being shot during a gun safety class, CBS Sacramento reports.

Tom Smith, a family pastor who also helps with church security, was shot by his own gun safety instructor.

Modesto Police say they were acting out a scenario when a loaded gun the instructor was holding accidentally went off. They say they gun fired at the end of class after the instructor put a mock gun down and picked up his real loaded gun.

Get Breaking News Delivered to Your Inbox

Police say so far it's unclear if the instructor believed he was using the mock gun he had been using to teach the class.

The shooting incident comes at a time when church members in California are training to carry concealed weapons in response to recent mass shootings like those at San Bernardino and at A.M.E. Church in Charleston, South Carolina.