An off-duty Richmond police officer was charged with three felonies Tuesday after he allegedly went on a shooting spree inside San Francisco’s Four Seasons Hotel over the weekend.

No one was hurt, though the shooter shot six or seven bullets on the hotel’s 17th floor, and at least one on the 12th floor on Sunday from around 5 to 6:30 am, when he surrendered, police said.

On Tuesday, the San Francisco district attorney’s office charged Phillip Sanchez, 45, on felony counts of discharging a firearm in an inhabited dwelling, negligent discharge of a firearm, vandalism over $400, and a misdemeanor count of brandishing a firearm.

Sanchez has also been placed on administrative leave from the Richmond Police Department while the matter is under internal investigation, said Lt. Felix Tan, a police spokesman, adding that he was unable to provide additional information about Sanchez while the investigation is active.

On Sunday morning, witnesses at the hotel at 757 Market St. described Sanchez as acting “erratically” and talking about spirits before opening fire, according to police dispatch recordings.

San Francisco police who responded to the emergency directed several hotel guests to remain in their rooms as they negotiated with the shooter, who had also been a guest at the upscale inn.

Not all guests got such direction — and some were terrified as they called down for meals or other services and got busy signals or no answer over and over.

“I thought maybe I should go down and say the phone’s not working,” said Kimberly Archie, 48, a legal consultant from Los Angeles and a frequent guest at the Four Seasons. But when she tried with her cell phone, she still couldn’t get through.

Finally, Archie opened her window drapes and saw that police had surrounded the hotel.

“I thought I was going to die,” said Archie, who finally reached a desk clerk who said there was a live shooter in the hotel and “don’t leave your room.”

Archie said she thinks hotels should have an alert system to notify guests of danger.

Meanwhile, Sanchez’s arraignment is pending.

Nanette Asimov is a San Francisco Chronicle staff writer. Email: nasimov@sfchronicle.com Twitter: @NanetteAsimov