When a pair of armed robbers barreled into a cellphone store in New Jersey demanding money and phones, they clearly didn't realize how quickly the manager would turn the tables on them, as evidenced by surveillance video.

The armed men burst into a Boost Mobile cellphone store in Paterson Wednesday afternoon and held up manager Tomy Torrez. He did what he was told.

"I say, check the walls and take whatever you want," Torrez told NBC 4 New York. "So when they were busy I start running to the back."

That's when Torrez got smart: he opened a back door that connected to another office and told everyone there they needed to get out. Then he went out another door from that space and slammed the gate there, blocking the back exit. And he went back to the front of the cellphone store and did the same thing from the outside.

Surveillance video shows the exact moment the metal gates slammed down on the storefront, sparking panic from the robbers.

"Get us outta here!" they shouted as they desperately tried to slam through the glass.

By that time, a crowd had gathered outside the store. They gawked and laughed at the robbers trapped inside, cellphone video taken by one of the passersby shows.

"I can't let you outta there!" an incredulous woman yells back at the robber from across the glass and metal gate.

Meanwhile, Torrez called police from outside. Paterson police confirmed to NBC 4 New York they got a call at 4:09 p.m. but said the person on the phone said, "Someone is stealing in my store." The operator thought it was a shoplifter, and police weren't dispatched right away.

At that point, the robbers were desperately trying to get out and finally, one of them finds the master set of keys and hands them to the people outside.

"Yo, yo, yo, I got the keys, yo," one of the robbers says.

But the people outside hand the keys to Torrez instead.

Police records show another call was made to 911 at 4:13. But still, a different operator thought it was a shoplifter, and still no police.

Eventually, the robbers wised up and found a toolbox. They unbolted the bars on a back window and escaped.

Records show a third call came into 911 at 4:27. This time, the operator was informed of a gun, and police were sent right away. But by that time, the bungling criminal duo had already escaped, leaving behind a mess and a bag with bullets and needles inside.

Torrez said he called police "like five times."

"I said, 'We got a robbery inside, they got a gun,'" Torrez said.

Paterson police said internal affairs are investigating and will use the incident to help retrain 911 operators.

As for those lucky robbers, police are still looking for them.