SAN FRANCISCO — An off-duty Richmond police officer was reported acting bizarrely before he fired multiple shots throughout a ritzy San Francisco hotel early Sunday, according to police radio recordings of the episode reviewed by this newspaper.

San Francisco police identified Phillip Sanchez, a 45-year-old Richmond sergeant, as the suspect in the active shooter incident, according to the recordings. The San Francisco County jail reported that Sanchez was booked on four felony counts: discharge of a firearm with gross negligence, firing at an inhabited enclosure, assault with a firearm and vandalism of more than $400. His bail was listed at $290,000.

He was released from the jail Monday afternoon after posting bail, said his attorney, Harry Stern.

“By all accounts, this incident is completely out of character; thus we are attempting to ascertain exactly what took place and why,” Stern said in a statement. “Witnesses report statements and behavior which may indicate a psychiatric episode. Everyone is extremely thankful that no one was injured.”

San Francisco police radio recordings indicate that law enforcement initially responded to reports of a hotel guest acting strangely around 4:55 a.m., but the intensity quickly ratcheted up after witnesses told first responders that the suspect fired multiple times on the 17th floor of the Four Seasons Hotel on Market Street. After almost two hours, with hotel guests sheltering in place and police sweeping the high-rise, the veteran Richmond police officer surrendered peacefully and was arrested around 6:30 a.m., San Francisco police Officer Robert Rueca said.

San Francisco police say no one was injured, and officers recovered a handgun and shell casings from the hotel, all of which came from the same gun. They have no idea what led to the strange behavior and shooting.

“We have nothing yet on what the suspect was shooting at,” Rueca said. “We don’t have a motive for why this happened.”

The Richmond cop will be placed on administrative leave, pending an investigation by both agencies, Richmond police Lt. Felix Tan said. Neither department has named the suspect officially to news outlets, and Richmond police did not return messages asking for comment Monday.

The initial call to police came as a suspicious hotel guest, but he was immediately identified as a Richmond officer.

“He’s walking erratically through the hotel calling for security, talking about spirits … ,” a dispatcher told responding officers, according to two hours of police audio. “The (reporting party) is stating this subject is a Richmond police officer and he doesn’t know if the subject is armed or not.”

The dispatcher continued saying the officer told his wife he was trying to get security to enter his room — identified as Room 604 — saying that “they know what is in there.”

Minutes later, a witness heard six or seven gunshots on the 17th floor, several rapid fire, according to the recordings.

Dispatchers put out an alert for all available officers to respond to a command post at O’Farrell and Grant streets. Officers blocked off Market Street and warned officers not to travel along that thoroughfare as the situation unfolded, according to the recordings.

Officers whispering to dispatchers could be heard giving their locations inside the hotel, many in stairwells. One reported back that he found eight 9mm shell casings on the 24th floor, according to the police audio.

At one point, dispatchers alerted officers he’s been spotted on the 12th floor.

“He’s last seen on his back. He has a black handgun in his hand,” a dispatcher told police.

Less than an hour into the search, officers reached the 12th floor, and Sanchez was arrested around 6:30 a.m. A San Francisco officer reported that he found two shell casings on that floor and a bullet hole through the glass by Room 1224, according to the recordings.

Police lifted a shelter-in-place order for guests around 6:45 a.m. at the hotel on the 700 block of Market Street.

“Just assessing the property damage, it seems relatively minor,” Rueca said Sunday of the damage inside.

The hotel, with rooms starting at $395 a night Monday, has 277 rooms and occupies the first 12 floors of the 42-story building. No obvious damage was visible inside the hotel and the various floors Monday afternoon, as Christmas music played inside and guests enjoyed holiday decorations. The 12th floor appeared to be under renovation.

Sanchez started working for Richmond police in 2008, and in a profile of the officer by online news site Richmond Confidential, he was described as someone who spoke in “measured tones that seem better-suited to a cubicle than a squad car.” In 2012, he won his third award for curbing drunk driving, tallying 101 DUI arrests that year.

In 2013, Sanchez became one of the first Richmond police officers to wear a body camera.

Staff writer Rick Hurd contributed to this report.