SACRAMENTO — A state employee who was arrested for bringing a loaded gun to the secretary of state”s office had been reprimanded for sending unsolicited messages to female co-workers, according to documents obtained by The Associated Press on Monday.

Court records say Bryan Keith Thurmond, 50, left a backpack containing a loaded gun, extra magazines and three knives in the agency”s downtown Sacramento office last week.

Security officers found the backpack in the men”s bathroom Jan. 19. It”s not clear whether it was hidden or was in plain sight of the officers.

A police report filed by the California Highway Patrol says when Thurmond was questioned by officers about why he had the weapons, he brought up issues he had with co-workers without prompting.

Thurmond said the gun was not for the people he had problems with at work. He said he was going shooting with his brother after work, according to the report.

He told officers he had been in trouble at work for sending inappropriate messages to two co-workers. Thurmond”s brother was unaware of any plans to go shooting, according to the report.

The report was filed in conjunction with a request by the secretary of state”s office for restraining orders on behalf of the two women filed with the Superior Court of Sacramento County. It was granted Friday.

Thurmond was fired from his temporary job on Friday, according to the secretary of state”s office. Thurmond has not yet been charged. He is scheduled to be arraigned Feb. 11. He was released from Sacramento County jail on Thursday.