A woman suffered what was later diagnosed as a heart attack and was taken out of the theater.
This triggered an alarm during the show, at the same time that gunfire went off on stage as part of the show's duel scene, adding to the confusion, city fire department spokesman Jonathan Baxter said.
"Dozens of us hid behind seats til police cleared us. Very scary," tweeted theatre-goer Marianne Favro.
Police say there was more chaos when another person yelled for help.
A witness told ABC7 News that someone yelled gun, which added to the panic.
People began running out of the theater.
Officials say three people were injured, one with a broken leg and two others with moderate injuries.
A large crowd was seen outside the theater, as well as several police cars.
The woman who had a heart attack was revived and remained hospitalized Saturday in critical condition, according to Baxter.
The performance did not continue but people were allowed back into the theater to grab their belongings.
The owner of the Orpheum said audience members were invited to see another performance of the popular Tony Award-winning show.
***BREAKING*** 1/3 At 2151 HRs An adult had a medical emergency at the Orpheum Theater An AED was pulled which also triggered an alarm during the Hamilton Play. This resulted is confusion, and an un-organized rapid exit of the theater. During this process, 3 additional adults -— SAN FRANCISCO FIRE DEPARTMENT (@SFFDPIO) February 16, 2019
***BREAKING 2/3*** were injured, one with a broken leg, and 2 with moderate injuries. @SFPD AND @SFFDPIO responded and confirmed that the incident was not an intentional act, and started the mitigation process. The @SF_emergency was also contacted and was standing by if needed.— SAN FRANCISCO FIRE DEPARTMENT (@SFFDPIO) February 16, 2019
***BREAKING*** 3/3 currently , the theater is repopulating. All 4 adults have been taken to area hospitals. The original patient who required an AED had a return of pulses with CPR and paramedic and remains in critical condition.— SAN FRANCISCO FIRE DEPARTMENT (@SFFDPIO) February 16, 2019
The Associated Press contributed to this report.