“The Shallows” had been playing for about 30 minutes when a man in the audience was repeatedly stabbed in the throat and chest by someone he’d never met, police said.

The man was attacked from behind Wednesday in Northern California while watching the new scary film about a female surfer, played by Blake Lively, being menaced by a huge shark.

Read: 'Slender Man' Mother Breaks Silence, Says Her Daughter Is Mentally Ill And Adult Charges Are 'BS'

The victim, identified as 21-year-old Adam Lucero, was taken to Santa Rosa Memorial Hospital and is expected to survive, police said.

Police later arrested Delonte Anthony Hart, 23, near the theater. He had dumped a large butcher knife in a lobby trash can before calmly walking out of the cinema, according to authorities.

Hart is homeless, and originally from Baltimore, Maryland, cops said. He has been in the Santa Rosa area for about four months.

Investigators are trying to determine if the vicious attack is connected to the death of Cirak Tesfazgi, 32, a homeless man who was knifed 50 times Monday in the doorway of a downtown building, the Press Democrat reported.

“Based on the randomness of the act, the brutality of the act, certainly he’s a person we’re looking into as a suspect,” said Sgt. Josh Ludtke, according to the paper.

Read: Beloved High School Teacher Dies Saving Pregnant Waitress From Stabbing

“Out of nowhere, he came up from behind him, he stabbed him in the throat, in the arm, in the lung,” Ludtke said.

Other moviegoers in the small audience rushed to help Lucero.

Watch: Why This Grandma Defends Her Daughter Charged With Stabbing Her Sons To Death