One of the actors immediately dropped his fake assault rifle. But another held onto his fake handgun, forcing officers to make a life-or-death choice.
"One of the officers made the decision that had the man moved, he would have been killed," said Glendora police Capt. Tim Staab. "It was just milliseconds from a tragedy occurring."
One of the officers, unaware of the filming, knocked the gun from the actor's hand and handcuffed him, drawing a peaceful climax to what could have been something far worse.
Still, police said it depicted the potential dangers in a movie-making region for amateur film crews who don't get permits and follow proper steps before taking to the streets.
"I can't think of a situation more dangerous than having a gun in your hand with cops responding," Staab said. "It was much closer than we ever want to get close to."
Attempts to reach the film's director were unsuccessful. The students declined to tell police what college they attended.
The officers responded to the shop after receiving a 911 call from a woman who reported seeing an armed, masked gunman inside Classic Coffee in Glendora, a suburb east of Los Angeles that sees relatively few Hollywood crews.
Police said there was nothing to indicate a short movie was being shot. No one was outside to warn customers, there were no signs, and no permit had been pulled.
When officers arrived, there was no question in their mind that a robbery was occurring, Staab said.
It's rare "to go into a coffee shop and see someone carrying an AR-15 rifle and wearing a mask," he said.
Under normal filming protocols, weapons carried by the actors have orange markings to indicate they are replicas. But the markings on the guns used by the students had been covered by a black pen, presumably to make the weapons look more realistic.
The standoff was captured on an audio recorder carried by officers, one of whom yells, "Drop the gun! Drop it! Drop it! (Expletive) drop it!"
Staab said one of the masked men, apparently startled by the real-life response, held the fake gun by his side, pointed toward the ground. When he didn't drop it, Staab said, an officer did something unusual - he stripped it from the man's hand and sent the gun falling to the floor.
After the man was handcuffed, the officer is heard on the audio tape asking what was going on. Somebody says a film was being made.
"You are shooting a short film?" the officer asks. "In a store with a man with a gun?"
Fred Sparling, who owns the coffee shop, told the San Gabriel Valley Tribune the crew had advised his manager that they were shooting a Christian movie and didn't mention the robbery scene until they arrived.
"I think he is darn lucky that the police didn't shoot him," Sparling said of the man who momentarily held his gun.
The students were allowed to keep the fake weapons and weren't facing any charges. They were given a lecture by officers about the dangers they created and went on their way.