SAN JOSE (CBS SF/AP) — Police arrested a man on Thursday night suspected of robbing and sexually assaulting a teacher in a classroom at a San Jose middle school on Tuesday morning.

Andrew Bracamonte

Andrew Bracamonte. (Police Booking Photo)

READ MORE: Flash Flood Watches Issued As Storm Aims at Fire-Scarred Northern California

San Jose Police Chief Eddie Garcia said 23-year-old Andrew Bracamonte had shaved his head and was trying to flee the area when he was arrested in San Francisco.

Garcia said that Bracamonte is accused of sexually assaulting a teacher inside a classroom at Harker Middle School on Tuesday morning before school started.

READ MORE: Magnitude 2.8 Earthquake Rattles East Bay Near Hercules

The chief said on Friday that Bracamonte lived about a quarter mile away from the middle school and that investigators are trying to figure out why he attacked the teacher Tuesday morning.

Officers responded to a report of a sexual assault at the middle school at 3800 Blackford Ave. at about 6:30 a.m. Tuesday.

The suspect was captured on surveillance video walking around the campus. He was wearing a black shirt and beanie.

MORE NEWS: New Facebook Whistleblower Says Executives Shrugged as Algorithm Stoked Hate, Misinformation

© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.