One of the actors immediately let go of his fake assault rifle. But another held onto his replica handgun, forcing officers to make a life-or-death choice. An officer knocked the gun from the actor's hand and handcuffed him, drawing a peaceful climax to what could have been something far worse.

"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."

Police said it showed the dangers of movie-making 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 were from.

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 rarely sees Hollywood film 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.

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 audiotape 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?"

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.

Copyright 2013 Associated Press

Copyright 2015 Associated Press. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.