(CNN) A teacher at the Parkland, Florida, high school where 17 students and teachers were shot to death was arrested for allegedly leaving a loaded gun in a public bathroom.

A homeless man is accused of picking it up and firing it.

According to a Broward County Sheriff's report, Sean Simpson removed his 9mm Glock pistol while using the bathroom at the Deerfield Beach Pier on Sunday and forgot it in the stall when he left to wash his hands.

He realized his mistake less than five minutes later and heard a shot while he was walking to recover his weapon, the report said.

Simpson told deputies that he saw a man holding the gun when he walked into the bathroom and grabbed it out of his hand, the report said.

Read More