BERKELEY -- A veteran UC Berkeley police officer shot himself in the leg Tuesday morning as he was getting ready for work in the department's locker room, police said.

"He was holstering his weapon and shot himself in the leg," said Police Capt. Margo Bennett. "It appears it's a straightforward injury and everything is going to be fine."

The officer was taken from the police station in the basement of Sproul Hall to Highland Hospital in Oakland with "non-life threatening" injuries said UC Berkeley Police spokesman Lt. Eric Tejada.

The officer, a 20-year veteran Tejada did not name, shot himself with a Heckler & Koch semi-automatic pistol, he said.

"There were other people in the room at the time, and I have to say our guys did an amazing job," Tejada said. "They jumped right into action and comforted him and tended to his injuries and waited until the Berkeley fire department paramedics got there."

Tejada said the gun the officer shot himself does not have a safety mechanism.

"It looks like it might have something to do with the equipment," said Tejada, who declined to be more specific as to the reason why the gun went off.

Tejada said the investigation would be done internally and the department would not call in a team from the Alameda County District Attorney's office as it does with other officer-involved shootings.

Doug Oakley covers Berkeley. Contact him at 510-843-1408. Follow him at Twitter.com/douglasoakley.