LOS ANGELES -- College filmmakers were using fake guns to shoot a robbery scene at a suburban Los Angeles coffee shop when eight police officers showed up with guns drawn and no idea it was just a movie.

"Drop the gun! Drop it! Drop it!" one officer yells on an audio recording police were carrying.

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

"I can't think of a situation more dangerous than having a gun in your hand with cops responding. It was much closer than we ever want to get close to,” he added.

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.

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.