Updated

A 47-year-old man was shot in both legs when he accidentally discharged a handgun while sitting in his cubicle at an insurance office, police said.

The man, who hasn't been publicly identified, had put his .45-caliber gun into his jacket pocket and then draped the jacket over the back of his chair, said Brett McGuire, Lake Worth police chief.

The gun discharged Tuesday morning as the man settled into his chair. He said the man must have done something to make the weapon fire.

The bullet passed through both of the man's legs and a bookcase before lodging in the wall of a cubicle.

McGuire said there was no indication the man had brought the gun to target anyone.

"He wasn't having problems with his bosses or co-workers that we know of," McGuire said.

McGuire said his department has no record of the man being licensed to carry a concealed weapon. He said detectives would wait until the man, who was taken to a hospital, had recovered before deciding whether to pursue charges.