OAKLEY — A man standing in a house garage suffered a gunshot wound Tuesday when another man pulled the trigger on a gun in the back room without knowing it was loaded, police said.

The shooting happened about 6 p.m. Tuesday in the 900 block of Almond Drive, off Orchard Park Drive. The 22-year-old victim went by ambulance to John Muir Medical Center in Walnut Creek, where he was treated for injuries that are not considered life-threatening.

Police arrested the man who fired the gun on suspicion of negligently discharging a firearm, Chief Eric Christensen said. The suspect was not immediately identified.

According to Christensen, the suspect was in a back room of the ranch-style one-story house and was showing somebody else the handgun.

“He failed to inspect whether the chamber was empty,” he said. “It appears he was demonstrating how to shoot it.”

The shot went off and sent a bullet sailing through the bedroom and through two walls, including one leading to the garage where the victim was standing, Christensen said.

Nobody else was injured.