REDWOOD CITY — A San Mateo County bailiff has been put on administrative leave after reports that he pulled his gun during a court recess on a custodian he was chatting with about the white South Carolina police officer charged with the murder of a fleeing black man, sources said.

A spokeswoman for the San Mateo County Sheriff’s Office acknowledged Friday afternoon that a bailiff, a deputy sheriff, has been put on leave.

“It’s the subject of a personnel matter, so we’re not at liberty to say anything about it,” public information officer Rebecca Rosenblatt said.

This newspaper is not naming the bailiff because he has not been charged. Sources close to the investigation said the incident started when the bailiff made a remark about the North Charleston incident that the custodian interpreted as racist.

The custodian objected, and it is then that the bailiff allegedly pulled his gun. A court reporter and clerk were in the Redwood City courtroom at the time.

The custodian then carefully retreated out of the courtroom with the gun trained on him, the sources said.

The incident is being investigated by the sheriff’s Internal Affairs unit. Depending on what the investigation finds, the bailiff could face criminal charges, possibly for brandishing a weapon. The officer could also face internal discipline.

Late last year, a San Jose police officer got in hot water for sending combative tweets aimed at protesters in Ferguson, Missouri, where a white police officer shot and killed a black man. The shooting was ruled justified, but it set off a firestorm of civil rights protests.

Contact Tracey Kaplan at 408-278-3482. Follow her at Twitter.com @tkaplanreport.